Solved

java call to gui opens tiny window

Posted on 2014-01-23
11
261 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unhandled exception type Exception 18 52
null output 3 42
by zero exception 10 69
Using jdbcTemplate.batchUpdate to improve INSERT performance 6 26
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

762 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