Solved

java call to gui opens tiny window

Posted on 2014-01-23
11
257 Views
Last Modified: 2014-01-23
I have created a small gui window and I am tryin to call it from another class but when I call it from the other class, just a tiny sliver of a window opens.

If I run it from within the gui class it opens up correctly.

I am attaching both classes. Can someone tell me what I'm doing wrong please?
AppWindowTest.java
Default.java
0
Comment
Question by:boukaka
  • 6
  • 5
11 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 39803592
Your variable called 'frame' is redundant (AppWindow IS a frame) and causes problems. Get rid of it
0
 

Author Comment

by:boukaka
ID: 39803616
When I remove 'frame' the window opens tiny from both classes....that's even worse....
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 39804100
This is what should happen when you follow my instructions:

The calling code is
AppWindowTest window = new AppWindowTest();
window.setVisible(true);

Open in new window

0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:boukaka
ID: 39804278
That is exactly what I did and it resulted in a tiny useless window
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39804288
Then you must have done it wrong
0
 

Author Comment

by:boukaka
ID: 39804301
Did you try to run it? The classes stand on their own so you could if you want to see what I'm seeing. Change the window.frame.setVisible(true) to window.setVisible(true) and run it... there must be something else creating that weird behavior
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39804305
Did you try to run it?
?? I've just posted a link to a screenshot of it running (properly)
0
 

Author Comment

by:boukaka
ID: 39804369
Well that's just nuts, this is what I see and you can see that I have adjusted the code...I'm baffled
0
 

Author Comment

by:boukaka
ID: 39804376
crap - no attachment, internet here is too slow...
0
 

Author Comment

by:boukaka
ID: 39804387
crazy, well I will accept your solution as correct because I believe that what you are saying is the right way to run it. There must be something wacky going on with my environment...
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39804698
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
simple java question 3 56
github account with ecipse 1 48
Windows 10 IE Certificate Issue 10 47
Is there a simpler dropbox system? 10 22
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question