Results 1 to 2 of 2
  1. #1
    garnachito is offline Member
    Join Date
    May 2012
    Rep Power

    Default Help with setEnabled

    Hi guys!

    I have this problem... I want to disable my main window when another window from another class is called.

    This is the code of my that opens the new JFrame:

    Java Code:
    		if(e.getSource()== OpenFrame){ 
    			second_window.main(null); //it calls a new JFrame  and you aren't supposed to use the main window while the new one is active.
    			this.setEnabled(false); // this is why with this we disable the main window
    And this is the code of my secondary window called this closes the new window and tries to go back to the main:

    Java Code:
    		if(e.getSource() == btnGoBack){
    			this.dispose(); // it closes the second window
    // Here is the problem-------
    			main_window.main(null); // if I call main_window again now there are 2 of them, one enabled, one disabled, obviously I don't want that.
    // I need to find a way to enable from here (I guess) the main window
    Thanks in advance

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power

Similar Threads

  1. setEnabled() makes fonts to light to read
    By rellicott in forum SWT / JFace
    Replies: 0
    Last Post: 02-13-2012, 06:21 PM
  2. setting JButton setEnabled() outside of main class
    By danborgir in forum New To Java
    Replies: 11
    Last Post: 05-07-2011, 05:03 PM
  3. JButton setEnabled
    By kbro3 in forum New To Java
    Replies: 5
    Last Post: 03-23-2011, 01:53 AM
  4. Problem with button.setEnabled
    By Dycu in forum SWT / JFace
    Replies: 0
    Last Post: 07-19-2010, 01:49 PM
  5. Replies: 4
    Last Post: 02-27-2009, 12:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts