Link to home
Start Free TrialLog in
Avatar of jkteater
jkteaterFlag for United States of America

asked on

JText Fields - populated

I have four JText fields in my dialog.  I am not sure that the right thing is to have them has JText fields.  When the dialog is being created, those fields will get values from a different place.  The fields should not be editable

Right now I have final

final JTextField curProject = new JTextField(20);
final JTextField cur3dTrans = new JTextField(20);
final JTextField cur2dTrans = new JTextField(20);
final JTextField curEmails = new JTextField(20);

example would be something like this (not exactly right, but the value will come from a differernt place)

ediProject.getProjectName() = curProject

So I need to have a field with a value and non editable by the user
What is the best way to do this?

Avatar of for_yan
for_yan
Flag of United States of America image

You dont need to have them final

JTextField cur2dTrans = new JTextField("your original text");
cur2dTrans.setEditable(false);


ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial