Showing posts with label swing. Show all posts
Showing posts with label swing. Show all posts

Sunday, May 21, 2006

JApplet not painting on init

my crapplet has internal JPanels, and it was not repainting on load, only when the window was resized.

solution:

add this:

Wednesday, May 10, 2006

JOptionPane Madness

String options[] = new String[]{"yes","no"};
int n = JOptionPane.showOptionDialog(frame,
"Would you like green eggs and ham?",
"A Silly Question",
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
null, //don't use a custom Icon
options, //the titles of buttons
options[0]); //default button title

Friday, March 10, 2006

WindowCloser code

i use this all the time:


this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
dispose();
}
});