9 Replies - 786 Views - Last Post: 30 August 2011 - 11:02 AM Rate Topic: -----

#1 trulysick   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 03-August 11

Linking GUI's

Posted 30 August 2011 - 08:11 AM

Hey there ppl.. I need help linking GUI's using Java Swing jframes. We havent gone over this in class and I cant find anything when googling. Basically I have the main window, then you hit a button and pulls up a form for data modifying.
tried doing new instances and just setting it to visible, but neither will work. It's probably just sytax...

this is what i've tried...
newEditGUI = new EditGUI;
temp EditGUI.setVisible(true);


//and this one...
EditGUI.setVisible(true);//after making the panel for the Gui invisible on startup..  
// this is not for homework... just a side project for organizing my bills..



Is This A Good Question/Topic? 0
  • +

Replies To: Linking GUI's

#2 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12800
  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: Linking GUI's

Posted 30 August 2011 - 08:23 AM

Quote

but neither will work

In the future, please be more specific as to what isn't working. Are you encountering errors? Be specific.

In this instance, it was your syntax. This is what you need to do:
EditGUI temp = new EditGUI(); //<-- notice the parentheses for the constructor
temp.setVisible(true); // <-- invoke setVisible() from the Object, not the class


Was This Post Helpful? 0
  • +
  • -

#3 trulysick   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 03-August 11

Re: Linking GUI's

Posted 30 August 2011 - 08:29 AM

well I'm just trying to link the gui's ... I have no clue how to do it and cant find any good help. I get syntax errors everything i try.. Plus i also dont know if it matters as how i set it up, to how it will work. I tried your way of using the temp, it loads but turns black in a second.
Was This Post Helpful? 0
  • +
  • -

#4 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12800
  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: Linking GUI's

Posted 30 August 2011 - 08:32 AM

I don't really have enough information to help you. We are the blind leading the blind at this point. To help you we will need:
-Your complete code
-Your exact error messages
Was This Post Helpful? 0
  • +
  • -

#5 trulysick   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 03-August 11

Re: Linking GUI's

Posted 30 August 2011 - 08:40 AM

Ok, I used your code, set the EditGUI visibility to false on load... Then when i hit modify, it loads, but turns black..
//this is my "Modify" button on the first GUI
 EditGUI temp = new EditGUI();//here is the event my button does, brings up EditGUI
	temp.setVisible(true);


//this is how i set the EditGUI to not display on load..
public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new EditGUI().setVisible(false);
            }
        });
    }


This post has been edited by macosxnerd101: 30 August 2011 - 08:41 AM
Reason for edit:: Fixed code tags

Was This Post Helpful? 0
  • +
  • -

#6 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12800
  • View blog
  • Posts: 45,992
  • Joined: 27-December 08

Re: Linking GUI's

Posted 30 August 2011 - 08:41 AM

I still do not have enough information to help you.

Please re-read my last post:

Quote

To help you we will need:
-Your complete code
-Your exact error messages

Was This Post Helpful? 0
  • +
  • -

#7 trulysick   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 03-August 11

Re: Linking GUI's

Posted 30 August 2011 - 08:51 AM

nvm It's looking like a graphical error... the black goes away when you resize.. Guess i'll up date netbeans and see if that patches it.
Was This Post Helpful? 0
  • +
  • -

#8 GregBrannon   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2250
  • View blog
  • Posts: 5,340
  • Joined: 10-September 10

Re: Linking GUI's

Posted 30 August 2011 - 10:20 AM

It's not a Netbeans problem. Netbeans is an editor.
Was This Post Helpful? 0
  • +
  • -

#9 trulysick   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 03-August 11

Re: Linking GUI's

Posted 30 August 2011 - 10:57 AM

Yep youre right. Updates didnt help. It turns black untill you resize it... Anyone know how to fix this? If not i will just go ahead and use the panel trick or switch to tabbed menus
Was This Post Helpful? 0
  • +
  • -

#10 GregBrannon   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2250
  • View blog
  • Posts: 5,340
  • Joined: 10-September 10

Re: Linking GUI's

Posted 30 August 2011 - 11:02 AM

Re-reread MacOSXNerd101's last post.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1