English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am following an example in a textbook, but I have to modify it to fit what I am trying to do. I have tried including everything in that program and only modify what I needed to, but for some reason, when I run my program, I get a blank JFrame window. What are possible reasons for this?

Thanks in advance!

2007-07-28 21:21:16 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

forgetting the content pane is a common problem.
Being lazy I usually start with:

JPanel mypanel = new JPanel;
getContentPane.add(myPanel);

then just format everything into the JPanel.

Being even more lazy, I usually just use the NetBeans IDE (which is a free download) and just drag and drop components visually, and let the IDE do most of the coding.

p.s. do not forget to put the JRadioButtons into a ButtonGroup or they won't "radio"

2007-07-28 22:33:31 · answer #1 · answered by oldguy 4 · 3 0

What was the code?

Is getContentPane() being used? And at end there must be a notify code to update the GUI according to the current layout.

2007-07-29 04:25:38 · answer #2 · answered by Andy T 7 · 1 0

fedest.com, questions and answers