271272273274275276277278279280281
if (parent.isDisposed()) return; final Rectangle clientArea = parent.getClientArea(); EventQueue.invokeLater(new Runnable () { public void run () { frame.setSize (clientArea.width, clientArea.height); frame.validate (); } }); } }); return frame;
7576777879808182838485
f.setExtendedState(Frame.MAXIMIZED_BOTH); } else { f.setExtendedState(Frame.NORMAL); } f.validate(); } else if ("minimize".equals(value)) { if (f.getExtendedState() == Frame.ICONIFIED) { f.setExtendedState(Frame.NORMAL);
444445446447448449450451452453454
frame.add(bean, BorderLayout.CENTER); frame.pack(); frame.setSize(600,400); frame.show(); bean.loadFromURL("private:factory/swriter", null); frame.validate(); // #1 Thread.sleep(1000); StringBuffer buf = new StringBuffer(1000); int i = 0;
459460461462463464465466467468469
public void run() { try { bean.releaseSystemWindow(); frame.remove(bean); frame.validate(); } catch (Exception e) { e.printStackTrace(); }
475476477478479480481482483484485
public void run() { try { frame.add(bean, BorderLayout.CENTER); bean.aquireSystemWindow(); frame.validate(); } catch (Exception e) { e.printStackTrace(); } } });
625626627628629630631632633634635
bean4.loadFromURL("private:factory/swriter", null); } catch( Exception e) { e.printStackTrace(); } f.validate(); Thread.sleep(10000); } finally {
4849505152535455565758
JTextArea jta = new JTextArea("SOUTH\nThis is a\nscrollable textarea.\nUse mouse wheel\nto see all the text\n"); f.add(new JScrollPane(jta), BorderLayout.CENTER); f.setSize(300, 300); f.setLocation(0, 0); f.validate(); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { f.dispose(); } });