the code to make a button

I know that you say panel(add button) when you want to make a button but how would you make one from scratch
[115 byte] By [denzitoa] at [2007-11-26 15:39:12]
# 1
search google, read a book or go to class
tjacobs01a at 2007-7-8 21:57:32 > top of Java-index,Java Essentials,New To Java...
# 2

> I know that you say panel(add button) when you want

> to make a button but how would you make one from

> scratch

import javax.swing.*;

import java.awt.*;

public class test

{

public static void main(String args[])

{

JFrame jframe=new JFrame("JFrame For A JButton");

jframe.setSize(200,200);

JButton jbutton=new JButton("JButton");

jframe.setLayout(new FlowLayout(FlowLayout.CENTER));

jframe.add(jbutton);

jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

jframe.setVisible(true);

}

}

qUesT_foR_knOwLeDgea at 2007-7-8 21:57:32 > top of Java-index,Java Essentials,New To Java...