JTextArea is hiding drop downs....
I have a JTextArea, a couple of JComboBoxes, and a JDateChooser in a FormLayout on one of my application tabs. Whenever I choose a date on the JDateChooser the dropdowns from the JComboBoxes or Date Chooser are hidden behind the JTextArea until I switch tabs. Has anyone else experienced this problem, and if so how do I go about fixing it?
The relevant code is below containing the JDateChooser, a couple other fields, and the comments JTextArea:
Code:
// date section
JLabel lblDate = new JLabel("Date");
lblDate.setFont(new Font("Times New Roman", Font.BOLD, 14));
p.add(lblDate, "2, 12, right, default");
Box dateBox = Box.createHorizontalBox();
p.add(dateBox, "4, 12");
JDateChooser jc = new JDateChooser();
jc.setDateFormatString("MM-dd-yyyy");
jc.setDate(new Date());
dateBox.add(jc);
TabOneDateListener todl = new TabOneDateListener();
jc.addPropertyChangeListener(todl);
// hours section
JLabel lblHoursUsed = new JLabel("Hours Used");
lblHoursUsed.setFont(new Font("Times New Roman", Font.BOLD, 14));
p.add(lblHoursUsed, "2, 14, right, default");
spinner = new JSpinner();
spinner.setFont(new Font("Tahoma", Font.BOLD, 16));
p.add(spinner, "4, 14, 1, 2, fill, fill");
HoursListener hl = new HoursListener();
spinner.addChangeListener(hl);
// engineer section
String uname = System.getProperty("user.name");
UpdateEngineeringHours.getInstance().setEngineer(uname);
JLabel lblEngineer = new JLabel("Engineer");
lblEngineer.setFont(new Font("Times New Roman", Font.BOLD, 14));
p.add(lblEngineer, "2, 18, right, default");
txtEngineer = new JTextField();
txtEngineer.setBackground(Color.LIGHT_GRAY);
txtEngineer.setEditable(false);
jpTab0.add(txtEngineer, "4, 18, fill, default");
txtEngineer.setColumns(10);
txtEngineer.setText(uname);
// comments section
JLabel lblComments = new JLabel("Comments");
lblComments.setFont(new Font("Times New Roman", Font.BOLD, 14));
p.add(lblComments, "2, 20, right, top");
txtComments = new TextArea(4,4);
p.add(txtComments, "4, 20, fill, top");
My jdk version is:
jdk1.7.0_02
My Operating System is:
Windows XP Professional Service Pack 3
My IDE is:
Eclipse Indigo Service Release 1
Build id: 20110916-0149
My JCalander Version is:
v1.4 - 07/09/2011
Any help will be greatly appreciated!
Thanks,
Robert
Re: JTextArea is hiding drop downs....
I actually found my own work-around just so everyone knows. instead of using a JTextArea I replaced it with a JEditorPane and encapsulated it with a JScrollPane. This is not a fix for the issue with JTextArea but it works around the problem. The JEditor Pane does not hide any of the drop-downs.
cheers,
Robert
Re: JTextArea is hiding drop downs....
JDateChooser is not a Swing class. Nor is JCalendar. I suggest you seek help or file a bug report wherever you got these classes or packages.
db