?
Solved

java call to gui opens tiny window

Posted on 2014-01-23
11
Medium Priority
?
267 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 2000 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

839 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