How to disable Netbeans highlighting?

I need your help in netbeans !!!?

  • HI everyone ,i need your help in my program , my program is about database , i designed buttons and menus for the operations , now i need to make checkbox to allow the user to disable the work of the buttons or make them enable by clicking the chechbox again , what code i have to write for this operation !!!!

  • Answer:

    JCheckbox uses ItemListener class MyDBProgram { JButton button; JCheckbox enableCkBox; boolean isEnabled; ... public MyDBProgram() { isEnabled = true; enableCkBox = new JCheckbox("Enable Opt"); enableCkBox.setSelected( true ); enableCkBox.addItemListener( this ); ... public vod itemStateChanged( Item e ) { Object source = e.getItemSelectable(); if( source == enableCkBox) { isEnabled = !isEnabled; // and also enableButton(); } private void enableButton() { button.setEnabled( isEnabled ); } }

liana at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.