JMenuBar hidden behind a TextArea?
for some reason the drop down menus are hidden behind the textarea is there a way to force it to the top?
[112 byte] By [
helen_166a] at [2007-11-26 12:30:12]

# 3
i create the menu first but if i switch it round it makes no difference
JMenuBar menuBar = new JMenuBar();
JMenu menu = new JMenu("Options");
menu.add(logOnAction);
menu.add(logOffAction);
menuBar.add(menu);
this.setJMenuBar(menuBar);
lblUserName = new JLabel("User Name: ");
lblUserName.setVisible(true);
c.weightx = 0.5;
c.gridx = 0;
c.gridy = 0;
c.fill = GridBagConstraints.HORIZONTAL;
jPanel.add(lblUserName, c);
txtChat = new TextArea("", 10, 5, TextArea.SCROLLBARS_VERTICAL_ONLY);
txtChat.setVisible(true);
this.add(txtChat);
# 5
> Post an> [url= http://mindprod.com/jgloss/sscce.html]SSCCE[/url]Really no need. This is an easy oneThis happens when you mix heavyweight and lightweight components. To fix, either use jtextarea instead of textarea or MenuBar instead of JMenuBar
# 6
jtxtChat = new TextArea("", 10, 5, JTextArea.SCROLLBARS_VERTICAL_ONLY);bad point is i cant add a scroll bar if i do that?
# 12
> is there a way to control the jscrollbar so it shows the info from the bottom firstit should automatically follow the caret, but if not, when adding text, includejtxtChat.setCaretPosition(jtxtChat.getDocument().getLength());