Jump to content

weird thing happening with gui not showing up correctly.


Recommended Posts

Posted (edited)

Hey, so while attempting to make my gui i have encountered a problem. when i call the gui to appear using gui.setvisible(true) I get a weird version where nothing pops up but it says that there is an open window in my open programs bar thing (picture for reference, the gui is the thing on window on the right). my Gui class is named "Gui" and is in the same package as the main class.

 

i also call it by using "public Gui gui = new Gui();" at the top of main before onStart()

 

in onStart the gui is set to visible with: "gui.setVisible(true);"

 

its weird because i use the gui the same way i did in other scripts and it worked fine there.

 

just wondering if anyone else has had this weird problem.

post-146248-0-07185000-1463474187_thumb.png

Edited by roguehippo
Posted

Hey, so while attempting to make my gui i have encountered a problem. when i call the gui to appear using gui.setvisible(true) I get a weird version where nothing pops up but it says that there is an open window in my open programs bar thing (picture for reference, the gui is the thing on window on the right). my Gui class is named "Gui" and is in the same package as the main class.

 

i also call it by using "public Gui gui = new Gui();" at the top of main before onStart()

 

in onStart the gui is set to visible with: "gui.setVisible(true);"

 

its weird because i use the gui the same way i did in other scripts and it worked fine there.

 

just wondering if anyone else has had this weird problem.

 

We will need to see some code to determine the issue. 

 

One reason could be that you have not set a size on your JFrame?

gui.setMinimumSize(new Dimension(500, 500));

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...