Kumpulan Script Bendera Program Berbasis Java Shape 2D
Kumpulan Script Bendera Program Berbasis Java Shape 2D. Berikut ini ada beberapa script java untuk membuat atau menggambar bendera menggunakan aplikasi NetBeans. Untuk penerapan scriptnya bisa baca di postingan sebelumnya tentang Program Berbasis Java Shape 2D Membuat Bendera di NetBeans atau bisa tonton video tutorialnya di bawah ini!
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Bendera_Negara extends JPanel {
public void paint(Graphics g){
try {
//Paste Kode Script disini
} catch (IOException ex) {
Logger.getLogger(Bendera_Negara.class.getName()).log(Level.SEVERE, null, ex);
}}
public static void main(String args[]){
Bendera_Negara panelGambar = new Bendera_Negara();
JFrame fr = new JFrame();
fr.setTitle(“ONEINSERT.COM – BENDERA – JAVA”);
fr.setSize(900,650);
fr.getContentPane().add(panelGambar);
fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
fr.setVisible(true);
}}
Download Gambar Pendukung Bendera : GDrive
Bendera Indonesia
//Indonesia
g.setFont(new Font("Seqoe UI", Font.BOLD, 20));
g.setColor(new java.awt.Color(110, 110, 110));
g.drawString("Indonesia", 300,90);
g.setColor (Color.red);
g.fillRect (300,100,150,50);
g.setColor (Color.white);
g.fillRect (300,150,150,50);
Bendera France
//France
g.setFont (new Font("Seqoe UI", Font.BOLD, 20));
g.setColor (new java.awt.Color(110, 110, 110));
g.drawString ("France", 50,90);
g.setColor (new java.awt.Color(71, 80, 255));
g.fillRect (50,100,70,100);
g.setColor (Color.white);
g.fillRect (100,100,70,100);
g.setColor (Color.red);
g.fillRect (150,100,50,100);
Bendera Denmark
//Denmark
g.setFont(new Font("Seqoe UI", Font.BOLD, 20));
g.setColor(new java.awt.Color(110, 110, 110));
g.drawString("Denmark", 550,90);
g.setColor (Color.red);
g.fillRect (550,100,150,50);
g.setColor (Color.red);
g.fillRect (550,150,150,50);
g.setColor (Color.white);
g.fillRect (590,100,20,100);
g.setColor (Color.white);
g.fillRect (550,140,150,20);
Bendera Germany
//Germany
g.setFont(new Font("Seqoe UI", Font.BOLD, 20));
g.setColor(new java.awt.Color(110, 110, 110));
g.drawString("Germany", 50,250);
g.setColor (Color.black);
g.fillRect (50,260,150,35);
g.setColor (Color.red);
g.fillRect (50,295,150,35);
g.setColor (Color.yellow);
g.fillRect (50,325,150,35);
Bendera Japan
//Japan
g.setFont(new Font("Seqoe UI", Font.BOLD, 20));
g.setColor(new java.awt.Color(110, 110, 110));
g.drawString("Japan", 300,250);
g.setColor (Color.white);
g.fillRect (300,260,150,100);
g.setColor (Color.red);
g.fillOval (345,280,60,60);
Bendera Norway
//Norway
g.setFont(new Font("Seqoe UI", Font.BOLD, 20));
g.setColor(new java.awt.Color(110, 110, 110));
g.drawString("Norway", 550,250);
g.setColor (Color.red);
g.fillRect (550,260,150,50);
g.setColor (Color.red);
g.fillRect (550,310,150,50);
g.setColor (Color.white);
g.fillRect (590,260,20,100);
g.setColor (Color.white);
g.fillRect (550,300,150,20);
g.setColor (Color.blue);
g.fillRect (595,260,10,100);
g.setColor (Color.blue);
g.fillRect (550,305,150,10);
Bendera Canada
//Canada
BufferedImage canada = ImageIO.read(new File("C:\\Users\\OneInsert.com\\Documents\\NetBeansProjects\\Bendera_Negara\\img\\Canada1.png"));
g.setFont(new Font("Seqoe UI", Font.BOLD, 20));
g.setColor(new java.awt.Color(110, 110, 110));
g.drawString("Canada", 50,410);
g.setColor(new java.awt.Color(212, 0, 0));
g.fillRect (50,420,30,100);
g.setColor (Color.white);
g.fillRect (80,420,90,100);
g.setColor(new java.awt.Color(212, 0, 0));
g.fillRect (170,420,30,100);
g.drawImage(canada, 90, 430, null);
Bendera Korea
//Korea
BufferedImage korea = ImageIO.read(new File("C:\\Users\\OneInsert.com\\Documents\\NetBeansProjects\\Bendera_Negara\\img\\Korea1.png"));
g.setFont(new Font("Seqoe UI", Font.BOLD, 20));
g.setColor(new java.awt.Color(110, 110, 110));
g.drawString("Korea", 300,410);
g.setColor (Color.white);
g.fillRect (300,420,150,100);
g.drawImage(korea, 320, 425, null);
Bendera Brazil
//Brazil
BufferedImage brazil = ImageIO.read(new File("C:\\Users\\OneInsert.com\\Documents\\NetBeansProjects\\Bendera_Negara\\img\\Brazil1.png"));
g.setFont(new Font("Seqoe UI", Font.BOLD, 20));
g.setColor(new java.awt.Color(110, 110, 110));
g.drawString("Brazil", 550,410);
g.setColor (new java.awt.Color(4, 156, 73));
g.fillRect (550,420,150,100);
g.drawImage(brazil, 570, 435, null);
Bendera Argentina
//Argentina
BufferedImage argentina = ImageIO.read(new File("C:\\Users\\OneInsert.com\\Documents\\NetBeansProjects\\Bendera_Negara\\img\\Argentina1.png"));
g.setFont(new Font("Seqoe UI", Font.BOLD, 20));
g.setColor(new java.awt.Color(110, 110, 110));
g.drawString("Argentina", 50,570);
g.setColor (new java.awt.Color(123, 160, 202));
g.fillRect (50,580,150,35);
g.setColor (Color.white);
g.fillRect (50,615,150,35);
g.setColor (new java.awt.Color(123, 160, 202));
g.fillRect (50,650,150,35);
g.drawImage(argentina, 107, 617, null);
United States
//United States
BufferedImage us = ImageIO.read(new File("C:\\Users\\OneInsert.com\\Documents\\NetBeansProjects\\Bendera_Negara\\img\\US1.png"));
g.setFont(new Font("Seqoe UI", Font.BOLD, 20));
g.setColor(new java.awt.Color(110, 110, 110));
g.drawString("United States", 300,570);
g.setColor (new java.awt.Color(193, 50, 54));
g.fillRect (300,580,150,8);
g.setColor (Color.white);
g.fillRect (300,588,150,8);
g.setColor (new java.awt.Color(193, 50, 54));
g.fillRect (300,596,150,8);
g.setColor (Color.white);
g.fillRect (300,605,150,8);
g.setColor (new java.awt.Color(193, 50, 54));
g.fillRect (300,613,150,8);
g.setColor (Color.white);
g.fillRect (300,621,150,8);
g.setColor (new java.awt.Color(193, 50, 54));
g.fillRect (300,629,150,8);
g.setColor (Color.white);
g.fillRect (300,637,150,8);
g.setColor (new java.awt.Color(193, 50, 54));
g.fillRect (300,645,150,8);
g.setColor (Color.white);
g.fillRect (300,653,150,8);
g.setColor (new java.awt.Color(193, 50, 54));
g.fillRect (300,661,150,8);
g.setColor (Color.white);
g.fillRect (300,669,150,8);
g.setColor (new java.awt.Color(193, 50, 54));
g.fillRect (300,677,150,8);
g.drawImage(us, 300, 577, null);
Malaysia
\\Malaysia
BufferedImage malaysia = ImageIO.read(new File("C:\\Users\\OneInsert.com\\Documents\\NetBeansProjects\\Bendera_Negagara\\img\\Malaysia1.png"));
g.setFont(new Font("Seqoe UI", Font.BOLD, 20));
g.setColor(new java.awt.Color(110, 110, 110));
g.drawString("Malaysia", 550,570);
g.setColor (Color.red);
g.fillRect (550,580,150,8);
g.setColor (Color.white);
g.fillRect (550,588,150,8);
g.setColor (Color.red);
g.fillRect (550,596,150,8);
g.setColor (Color.white);
g.fillRect (550,605,150,8);
g.setColor (Color.red);
g.fillRect (550,613,150,8);
g.setColor (Color.white);
g.fillRect (550,621,150,8);
g.setColor (Color.red);
g.fillRect (550,629,150,8);
g.setColor (Color.white);
g.fillRect (550,637,150,8);
g.setColor (Color.red);
g.fillRect (550,645,150,8);
g.setColor (Color.white);
g.fillRect (550,653,150,8);
g.setColor (Color.red);
g.fillRect (550,661,150,8);
g.setColor (Color.white);
g.fillRect (550,669,150,8);
g.setColor (Color.red);
g.fillRect (550,677,150,8);
g.drawImage(malaysia, 550, 577, null);