Red de conocimiento informático - Material del sitio web - Proceso de programación en línea

Proceso de programación en línea

//Modificado. Relativamente simple.

Importar Java.awt.gridlayout;

Importar javax.swing.jbutton;

Importar javax.swing.jframe;

Público Clase TestJFrame {

Public TestJFrame() {

Marco JFrame = new JFrame("Este es un

frame.getContentPane()). setLayout(new GridLayout(2, 4));

for(int I = 1; i lt= 8; i)

frame.add(new JButton(" I)) ;

marco . setdefaultcloseoperación(JFrame. EXIT _ ON _ CLOSE);

frame.setSize(300, 100

frame set visible(true); );

}

Public static void main(String[] args) {

testj frame a = new testj frame();

}

}