Menambahkan Label(JLabel) pada java
import javax.swing.*;
public class TambahKomponen1 extends JFrame{
public TambahKomponen1() {
Container content= this.getContentPane();
content.setLayout(new FlowLayout());
JLabel lbl=new JLabel("COBA");
content.add(lbl);
setSize(200,200);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public static void main(String args []){
SwingUtilities.invokeLater(new Runnable(){
public void run(){
new TambahKomponen1().setVisible(true);
}
});
}
}
{ 0 komentar... Views All / Send Comment! }
Posting Komentar