/*
* @NGATMIN
* @2112R0558
* STMIK HIMSYA SEMARANG
*/
import javax.swing.*;
import java.awt.*;
public class soal_3a extends JFrame {
JTextArea tombol;
public soal_3a(){
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
tombol = new JTextArea("");
JScrollPane js = new JScrollPane(tombol);
js.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
js.setBounds(20, 20, 320, 230);
getContentPane().add(js);
getContentPane().setLayout(null);
for(int n=0; n<100; n++){
tombol.append(" NGATMIN | STMIK HIMSYA SEMARANG\n");
tombol.setBackground(Color.GREEN);
tombol.setFont(new Font("Arial Black",1,12));
}
this.setSize(370,300);
this.setLocationRelativeTo(null);
this.setResizable(false);
this.setTitle("Soal 2 | for");
setVisible(true);
}
public static void main(String []aa){
new soal_3a();
}
}
Senin, 17 Maret 2014
java
0 Response to "Contoh Penggunaan Fungsi for pada java dengan JFrame"
Posting Komentar