Home
About
Contact
Sholahuddin Blog's
Home
Label
_Contoh Laporan
_Download
_Info
_Kuliah
_Pemograman C
_Pemograman Java
_Pengolahan Citra
_Tips & Trik
_Pemograman SQL
Beranda
Pemograman Java
Program Sederhana Java Membuat Interface GUI
Program Sederhana Java Membuat Interface GUI
Pemograman Java
Sholahuddin
08.41
Source Code:
import javax.swing.*; class elearning extends JFrame { JLabel nim=new JLabel( "NIM "); JLabel nim_2=new JLabel( ": 13111019 "); JLabel nama=new JLabel("Nama "); JLabel nama_2=new JLabel( ": Sholahuddin Al-Ayubi "); JLabel biodata=new JLabel("E-Learning (Edentity)"); //textfield nim JLabel field_nim=new JLabel("NIM"); JTextField textnim=new JTextField(20); //textfield nama JLabel field_nama=new JLabel("Name"); JTextField textnama=new JTextField(50); //textfield alamat JLabel alamat=new JLabel("Address"); JTextField textalamat=new JTextField(50); //textfield Kelamin JLabel gender=new JLabel("Gender"); JRadioButton radiocowok=new JRadioButton("Male"); JRadioButton radiocewek=new JRadioButton("Female"); ButtonGroup groupjenis=new ButtonGroup(); //textfield agama JLabel labelagama=new JLabel("Religion"); String[] agama={"--Pilih Agama--","Islam","Kristen","Katholik","Hindu","Budha"}; JComboBox comboagama=new JComboBox(agama); //textfield email JLabel email=new JLabel("Email"); JTextField textemail=new JTextField(50); //textfield facebook JLabel fb=new JLabel("Facebook"); JTextField textfb=new JTextField(50); //textfield hp JLabel labeltelp=new JLabel("Phone"); JTextField texttelp=new JTextField(50); //button JButton buttonsave=new JButton("Save"); JButton buttonupdate=new JButton("Update"); JButton buttonexit=new JButton("Exit"); elearning() { setTitle("GUI Java Sholahuddin Al-Ayubi"); setLocation(300,100); setSize(400,450); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } void Project() { getContentPane().setLayout(null); getContentPane().add(nim); nim.setBounds(30,10,100,50); getContentPane().setLayout(null); getContentPane().add(nim_2); nim_2.setBounds(150,10,150,50); getContentPane().setLayout(null); getContentPane().add(nama); nama.setBounds(30,30,100,50); getContentPane().add(nama_2); nama_2.setBounds(150,30,150,50); getContentPane().add(biodata); biodata.setBounds(150,80,150,50); //textfield pengisian nim getContentPane().add(field_nim); field_nim.setBounds(30,110,100,50); getContentPane().add(textnim); textnim.setBounds(150,125,100,20); //textfield pengisian nama getContentPane().add(field_nama); field_nama.setBounds(30,140,100,50); getContentPane().add(textnama); textnama.setBounds(150,155,120,20); //textfield pengisian alamat getContentPane().add(alamat); alamat.setBounds(30,170,100,50); getContentPane().add(textalamat); textalamat.setBounds(150,185,200,20); //textfield pengisian genre getContentPane().add(gender); gender.setBounds(30,200,100,50); getContentPane().add(radiocowok); radiocowok.setBounds(150,215,100,20); getContentPane().add(radiocewek); radiocewek.setBounds(230,215,250,20); groupjenis.add(radiocowok); groupjenis.add(radiocewek); //textfieldpengisian agama getContentPane().add(comboagama); comboagama.setBounds(30,230,100,50); getContentPane().add(comboagama); comboagama.setBounds(150,245,120,20); //textfieldpengisian email getContentPane().add(email); email.setBounds(30,260,100,50); getContentPane().add(textemail); textemail.setBounds(150,275,150,20); //textfieldpengisian facebook getContentPane().add(fb); fb.setBounds(30,290,100,50); getContentPane().add(textfb); textfb.setBounds(150,305,150,20); //textfield pengisian hp getContentPane().add(labeltelp); labeltelp.setBounds(30,320,100,50); getContentPane().add(texttelp); texttelp.setBounds(150,335,150,20); //button getContentPane().add(buttonsave); buttonsave.setBounds(50,370,100,20); getContentPane().add(buttonupdate); buttonupdate.setBounds(155,370,100,20); getContentPane().add(buttonexit); buttonexit.setBounds(260,370,100,20); setVisible(true); } public static void main(String[]args) { elearning se=new elearning(); se.Project(); } }
Screenshoot Output:
Download:
Program Sederhana Java Membuat Interface GUI.java
Posting Komentar
0 Komentar
Social Plugin
Cari Artikel?
Hosting No #1 Indonesia
Latest Posts
Labels
Contoh Laporan
4
Download
6
Info
11
Kuliah
13
Pemograman C
5
Pemograman Java
4
Pemograman sql
2
Pengolah Citra
1
Tips-Trik
16
0 Komentar