Re: Swing GUI
- From: RedGrittyBrick <redgrittybrick@xxxxxxxxxxxxx>
- Date: Wed, 22 Aug 2007 10:35:54 +0100
lando wrote:
Where can I found examples for a gui with a big textarea and some buttons ?
Thanks.
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
public class ABigTextAreaAndSOmeButtons {
// constructor
ABigTextAreaAndSOmeButtons() {
JPanel p = new JPanel();
p.add(new JTextArea(40,80));
p.add(new JButton("This"));
p.add(new JButton("That"));
p.add(new JButton("Other"));
JFrame f = new JFrame("A big text area with some buttons");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.add(p);
f.pack();
f.setVisible(true);
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new ABigTextAreaAndSOmeButtons();
}
});
}
}
.
- Follow-Ups:
- Re: Swing GUI
- From: RedGrittyBrick
- Re: Swing GUI
- References:
- Swing GUI
- From: lando
- Swing GUI
- Prev by Date: Eclipse plugin : Browser View query
- Next by Date: Re: Swing GUI
- Previous by thread: Swing GUI
- Next by thread: Re: Swing GUI
- Index(es):