Google Translate

Tampilan Aplikasi Sederhan Java GUI


copy coding ini dan pastekan di notepad++ lalu compaile menguunkan jdk versi 7..!!


import java.awt.Color;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class myEyesGUI extends JFrame {
    private JPanel pnlUtama;
    private JPanel pnlHeader;
    private JPanel pnlContext;
    private JPanel pnlNum;
    private JPanel pnlSource;
    private JPanel pnlFooter;

    public myEyesGUI() {
        initComponent();
        this.setLocationRelativeTo(this);
    }

    public void initComponent() {

        pnlUtama = new JPanel();
        pnlHeader = new JPanel();
        pnlContext = new JPanel();
        pnlNum = new JPanel();
        pnlSource = new JPanel();
        pnlFooter = new JPanel();

        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        this.setTitle("GUI nya kakaks");
        this.getContentPane().setLayout(null);
        this.setResizable(false);
        this.setSize(450, 380);
        this.add(pnlUtama);

        pnlUtama.setLayout(null);
        pnlUtama.setBackground(new Color(0,0,0)); // BLACK BRO
        pnlUtama.setOpaque(true);
        pnlUtama.setBounds(0,0,450,350);

        pnlHeader.setLayout(null);
        pnlHeader.setBackground(new Color(255,13,13)); // RED BRO
        pnlHeader.setOpaque(true);
        pnlUtama.add(pnlHeader);
        pnlHeader.setBounds(0,0,450,50);

        pnlContext.setLayout(null);
        pnlContext.setBackground(new Color(255,255,13)); // YELLOW BRO
        pnlContext.setOpaque(true);
        pnlUtama.add(pnlContext);
        pnlContext.setBounds(0,50,250,200);

        pnlNum.setLayout(null);
        pnlNum.setBackground(new Color(13,128,13)); // GREEN BRO
        pnlNum.setOpaque(true);
        pnlUtama.add(pnlNum);
        pnlNum.setBounds(0,250,250,100);

        pnlSource.setLayout(null);
        pnlSource.setBackground(new Color(13,13,255)); // BLUE BRO
        pnlSource.setOpaque(true);
        pnlUtama.add(pnlSource);
        pnlSource.setBounds(250,50,200,250);

        pnlFooter.setLayout(null);
        pnlFooter.setBackground(new Color(255,13,255)); // PINK KAKs
        pnlFooter.setOpaque(true);
        pnlUtama.add(pnlFooter);
        pnlFooter.setBounds(250,300,200,50);
    }

    public static void main(String[] args) {
        myEyesGUI me = new myEyesGUI();
        me.setVisible(true);
    }
}
Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...

0 comments

:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

 
© ILMU TEKNIK INFORMATIKA
Designed by BlogThietKe Cooperated with Duy Pham
Released under Creative Commons 3.0 CC BY-NC 3.0
Posts RSSComments RSS
Back to top