I have a JInternalFrame with a JTabbedPane on it. The JTabbedPane has six tabs and each tab has its own components like buttons, tables, textfields.
Now, I need to load this JInternalFrame in two modes. The first mode is editing mode, user can add record, delete record and apply change. The second mode is monitoring mode. user can only view it, all the buttons should be disabled, and all the textfields are uneditable.
Does anyone know how to disable all these components in a simple way? What I mean is not to change them one by one. I am trying to use something like:
but it doesn't do the job.
Now, I need to load this JInternalFrame in two modes. The first mode is editing mode, user can add record, delete record and apply change. The second mode is monitoring mode. user can only view it, all the buttons should be disabled, and all the textfields are uneditable.
Does anyone know how to disable all these components in a simple way? What I mean is not to change them one by one. I am trying to use something like:
Code:
Component cp[] = tbInternalFrame.getComponents();
for(int i=0;i<cp.length;i++){
cp[i].setEnabled(false);
}
tbInternalFrame.setVisible(true);
but it doesn't do the job.