setContentPane(cp); pack();
pack(); // Must re-pack to calculate proper size.
@Override public void actionPerformed(ActionEvent e) { if (!getFocusableWindowState()) { setFocusableWindowState(true); setBottomPanel(); textArea.removeMouseListener(tipListener); pack(); addWindowFocusListener(new WindowAdapter() { @Override public void windowLostFocus(WindowEvent e) { ft.possiblyDisposeOfTipWindow(); } }); ft.removeListeners(); if (e==null) { // Didn't get here via our mouseover timer requestFocus(); } } }
/** * Workaround for JEditorPane not returning its proper preferred size * when rendering HTML until after layout already done. See * http://forums.sun.com/thread.jspa?forumID=57&threadID=574810 for a * discussion. */ void fixSize() { Dimension d = textArea.getPreferredSize(); Rectangle r = null; try { r = textArea.modelToView(textArea.getDocument().getLength()-1); d.height = r.y + r.height; // Ensure the text area doesn't start out too tall or wide. d = textArea.getPreferredSize(); d.width = Math.min(d.width+25, 320); d.height = Math.min(d.height, 150); textArea.setPreferredSize(d); } catch (BadLocationException ble) { // Never happens ble.printStackTrace(); } pack(); // Must re-pack to calculate proper size. }
setContentPane(cp); pack();
setContentPane(cp); pack();
pack(); // Must re-pack to calculate proper size.
@Override public void actionPerformed(ActionEvent e) { if (!getFocusableWindowState()) { setFocusableWindowState(true); setBottomPanel(); textArea.removeMouseListener(tipListener); pack(); addWindowFocusListener(new WindowAdapter() { @Override public void windowLostFocus(WindowEvent e) { ft.possiblyDisposeOfTipWindow(); } }); ft.removeListeners(); if (e==null) { // Didn't get here via our mouseover timer requestFocus(); } } }
public void actionPerformed(ActionEvent e) { if (!getFocusableWindowState()) { setFocusableWindowState(true); setBottomPanel(); textArea.removeMouseListener(tipListener); pack(); addWindowFocusListener(new WindowAdapter() { public void windowLostFocus(WindowEvent e) { ft.possiblyDisposeOfTipWindow(); } }); ft.removeListeners(); if (e==null) { // Didn't get here via our mouseover timer requestFocus(); } } }