Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Enable/Disable JPanel and its ComboBoxes

  1. #1
    Member
    Join Date
    Sep 2014
    Posts
    31
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Enable/Disable JPanel and its ComboBoxes

    Hi, Ill explain what im stuck on,
    I have a class that extends JFrame, within that, i have set up JPanel where within that i have four JComboBoxes, I am to enable this JPanel and its JComboBoxes at the end of a method

    the code for that method is:

     private void tableNumberJComboBoxItemStateChanged()
       {
           // load data for table
           try
           {
               // get data for table
               myResultSet = myStatement.executeQuery("SELECT * FROM"
               + "restauranttables WHERE tableNumber = " + Integer.parseInt(
                       selectedTableNumber));
     
               //If myResultSet is not empty
               if(myResultSet.next() == true)
               {
                   waiterNameJTextField.setText(myResultSet.getString("Waiter Name"));
                   subtotal = myResultSet.getDouble("Subtotal");
                   displayTotal(subtotal);
               }
               // close myResultSet
               myResultSet.close();
           }
           //SQLException catched
           catch (SQLException exception)
           {
               exception.printStackTrace();
           } // end catch SQLException
     
       } // end of method tableNumberJComboBoxItemStateChanged

    I am not sure how to enable this JPanel? I have another Jpanel to Disable but one question at a time i suppose.


  2. #2
    Member
    Join Date
    Mar 2011
    Posts
    84
    My Mood
    Daring
    Thanks
    17
    Thanked 1 Time in 1 Post

    Default Re: Enable/Disable JPanel and its ComboBoxes

    Code you provided has something to with Database.
    read here, it may help you.

  3. #3
    Member
    Join Date
    Sep 2014
    Posts
    31
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Enable/Disable JPanel and its ComboBoxes

    Although that may be helpful, i got it working, cheers anyways

Similar Threads

  1. How to set disable JFrame but keep enable JMenubar?
    By Akronix in forum AWT / Java Swing
    Replies: 6
    Last Post: April 20th, 2013, 01:42 PM
  2. How to enable wrapping in JTextPane
    By kcaz in forum AWT / Java Swing
    Replies: 7
    Last Post: December 2nd, 2012, 03:04 PM
  3. Comboboxes in JFrame
    By rajesh3006 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: May 1st, 2012, 01:34 PM
  4. MultiSet - Enable assertions.
    By kiiliikii in forum What's Wrong With My Code?
    Replies: 7
    Last Post: December 9th, 2011, 05:34 PM
  5. how to enable tombol
    By ndoe in forum AWT / Java Swing
    Replies: 0
    Last Post: August 13th, 2009, 08:21 AM

Tags for this Thread