Results 1 to 4 of 4
Thread: Swing: unstabel window paint?
- 06-03-2010, 12:33 PM #1
Member
- Join Date
- Jun 2010
- Posts
- 14
- Rep Power
- 0
Swing: unstabel window paint?
Good day everyone,
I have got a little problem with java/swing. When I create a window with JFrame, a JMenuBar and a JPanel the windows does not load well.
I only have got two windows which have both a JMenuBar and a JPanel. The main window has the problem that the JPanel does not load all the time and the about box (main window > JMenuBar > Help > About...) is sometimes too small, sometimes as big as the whole screen and sometimes the JMenuBar has space above it... The strange thing is that if you reopen the same window in the same session, it can look different and when you resize a window, you'll see it as it was meant to be..? I tried to repaint the components, but that did not help. So what did I do wrong?
In the attachment you'll find my source as well as the .class files.
I'm working on a ubuntu 10.4 system with
javac 1.6.0_20
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8) (6b18-1.8-0ubuntu1)
OpenJDK Client VM (build 14.0-b16, mixed mode, sharing)
Ow, It is for school btw. Not really homework, but an extra project. I only have had a single Java starters course and this is a product of one day reading all kind of tutorials, one half a day typing and testing and three days trying to solve this error.
- 06-03-2010, 01:03 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
I didn't read all of your code but I noticed that an AnaFoldMain extends an AbstractWindow which extends from a JFrame but it also has a JFrame. That doesn't sound right to me.
kind regards,
Jos
- 06-03-2010, 01:50 PM #3
Member
- Join Date
- Jun 2010
- Posts
- 14
- Rep Power
- 0
Hey Jos,
Thank you for you reply! It seems you were right.
I deleted "extends JFrame" and altered the rest of my code so that there were no errors when compiling and now it works fine.
Bedankt!
Groeten, Jos (yea, thats is my name as well)
- 06-03-2010, 02:25 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
Need to pass a value from a parent window to a pop up or child window
By blackpanther in forum Advanced JavaReplies: 4Last Post: 01-10-2010, 07:48 AM -
change url in parent window from child window
By rakesh_n_mehta in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 07-09-2009, 12:17 PM -
how can i move one frame window to another window
By santhosh_el in forum AWT / SwingReplies: 8Last Post: 06-10-2009, 03:36 PM -
help?! paint on top of swing components on JPanel
By beam2008 in forum AWT / SwingReplies: 1Last Post: 12-05-2008, 04:15 AM -
XTerm window appearing in full screen swing app
By clarose in forum AWT / SwingReplies: 1Last Post: 11-17-2008, 10:56 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks