/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package perpusgui1; import java.awt.*; import javax.swing.*; /** * * @author CRAY */ public class pinjamDialog extends JDialog{ private JButton pinjam; private JLabel user, nama, NIM, alamat, koleksi, judul, ID_Koleksi; private JTextField tNama, tNIM, tAlamat, tJudul, tID_koleksi; public pinjamDialog(Frame f){ super (f); this.setSize(500,380); this.setLocationRelativeTo(null); this.setLayout(null); this.setVisible(true); this.setResizable(true); this.setTitle("Pinjam dialog"); pinjam=new JButton ("Pinjam"); user =new JLabel ("User : "); nama =new JLabel ("Nama : "); NIM =new JLabel ("NIM : "); alamat =new JLabel ("Alamat : "); koleksi =new JLabel ("Data Koleksi : "); judul =new JLabel ("Judul : "); ID_Koleksi =new JLabel ("ID Koleksi : "); tNama=new JTextField(); tNIM=new JTextField(); tAlamat=new JTextField(); tJudul=new JTextField(); tID_koleksi=new JTextField(); // user.setSize(60,50); user.setBounds(10, 10, 100,60); nama.setBounds(20, 40, 100, 60); NIM.setBounds(20, 81, 100, 60); alamat.setBounds(20, 122, 100, 60); koleksi.setBounds(10, 175, 100, 60); judul.setBounds(20, 205, 60, 60); ID_Koleksi.setBounds(20, 246, 100, 60); tNama.setBounds(120, 60, 350, 22); tNIM.setBounds(120, 100, 350, 22); tAlamat.setBounds(120, 140, 350, 22); tJudul.setBounds(120, 224, 350, 22); tID_koleksi.setBounds(120, 264, 350, 22); pinjam.setBounds(350, 300, 80, 30); this.getContentPane().add(user); this.getContentPane().add(nama); this.getContentPane().add(NIM); this.getContentPane().add(alamat); this.getContentPane().add(koleksi); this.getContentPane().add(judul); this.getContentPane().add(ID_Koleksi); this.getContentPane().add(tNama); this.getContentPane().add(tNIM); this.getContentPane().add(tAlamat); this.getContentPane().add(tJudul); this.getContentPane().add(tID_koleksi); this.getContentPane().add(pinjam); } public static void main(String[] args) { pinjamDialog pinjam = new pinjamDialog(new JFrame()); pinjam.setVisible(true); } }