Results 1 to 5 of 5
- 04-23-2009, 07:17 PM #1
Member
- Join Date
- Apr 2009
- Posts
- 15
- Rep Power
- 0
[SOLVED] using checkbox to set textfeild's un/editable parameter
Hi
I am using netbeans since its easier for me to creat the gui.
now i am working on making it linked with each other
here is my code where my checkbox controls the text feild i.e. if selected it is not editable but when unchecked it is editable
for soem reason nothing works
any hints/tips
ALSO can i do this using the connection wizard in netbeans
private void lockCBItemStateChanged(java.awt.event.ItemEvent evt) {
// this locks and unlocks all the desired textfields
if(lockCB.isSelected()==true)
tstepsTF.setEditable(false);
else
tstepsTF.setEditable(true);
}
- 04-23-2009, 07:21 PM #2
Member
- Join Date
- Apr 2009
- Posts
- 15
- Rep Power
- 0
also
I also tried this
private void lockCBItemStateChangedtest(java.awt.event.ItemEven t evt) {
tstepsTF.setEditable(tstepsTF.isEditable());
}
- 04-23-2009, 08:19 PM #3
Where is that code? It should be in some kind of ItemListener, with the signature
and added to the checkbox with addItemListener() otherwise it will not work.Java Code:public void itemStateChanged(ItemEvent evt)
Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
How To Ask Questions The Smart Way
- 04-23-2009, 08:36 PM #4
Member
- Join Date
- Apr 2009
- Posts
- 15
- Rep Power
- 0
yea its present
yup its present in the auto generated code by netbeans
lockCB.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
lockCBItemStateChanged(evt);
}
});
also
im using the preview design window that should not be a big deal rather than running it right?
- 04-23-2009, 08:37 PM #5
Member
- Join Date
- Apr 2009
- Posts
- 15
- Rep Power
- 0
Similar Threads
-
Using Editable Pdf form fields in Application
By jiten.mistry in forum Advanced JavaReplies: 5Last Post: 09-21-2011, 08:37 PM -
Auto updation of Editable Column Indexes
By Gajesh Tripathi in forum AWT / SwingReplies: 0Last Post: 10-23-2008, 10:23 AM -
Creating a non-editable combo box
By Java Tip in forum SWTReplies: 0Last Post: 07-07-2008, 04:45 PM -
Jtree - making parts editable
By kmarie in forum AWT / SwingReplies: 1Last Post: 07-27-2007, 02:34 AM -
How can i set the table's column dragable/movable false and cell editable
By johnt in forum AWT / SwingReplies: 4Last Post: 05-19-2007, 11:15 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks