开发者

Java Swing Maximize button of JFrame disappearss

I have created a java frame. It contains a JSplitPane. In the right partition of the splitpane , I have put JTextPane. Now I have kept JButton somewhere on the frame. When I click the button, a new JTextArea is inserted in the JTextPane as follows

JTextArea newTextBox = new JTextArea(1, 1);
StyleConstants.setComponent(style, newTextBox);

My problem is as soon as I insert JTextArea in JTextPane, the maximize button of my JFrame disappears. Can an开发者_StackOverflow中文版yone tell me what could be the reason of happning this.


Maxmize button is unavailable on two conditions:

  1. For a Dialog, in which case only close(X) button is availabe.
  2. If frame.setResizable(false) has been called(i.e diabled resize of window)

So applying this to your case, my best guess is that somewhere in your button's action you may have made it unresizable.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜