Jump to content

weird thing happening with gui not showing up correctly.


roguehippo

Recommended Posts

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
Link to comment
Share on other sites

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));
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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