frame.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
/** * Creates a new dialog. * @param owner the owner of this dialog * @param station the station for which this dialog is used */ public DialogParent( Dialog owner, FlapDockStation station ){ super(owner, false); setUndecorated(true); getRootPane().setWindowDecorationStyle(JRootPane.NONE); this.station = station; }
/** * Creates a new dialog. * @param owner the owner of this dialog * @param station the station for which this dialog is used */ public DialogParent( Frame owner, FlapDockStation station ){ super(owner, false); setUndecorated(true); getRootPane().setWindowDecorationStyle(JRootPane.NONE); this.station = station; }
/** * Creates a new dialog. * @param owner the owner of this dialog * @param station the station for which this dialog is used */ public DialogParent( Frame owner, FlapDockStation station ){ super(owner, false); setUndecorated(true); getRootPane().setWindowDecorationStyle(JRootPane.NONE); this.station = station; }
/** * Creates a new dialog. * @param owner the owner of this dialog * @param station the station for which this dialog is used */ public DialogParent( Dialog owner, FlapDockStation station ){ super(owner, false); setUndecorated(true); getRootPane().setWindowDecorationStyle(JRootPane.NONE); this.station = station; }
public void run() { StringBuilder sb = new StringBuilder("<p>There were errors:</p><table border=1 cellspacing=1 cellpadding=1>"); for (ObjectName on : result.keySet()) { Throwable t = ExceptionHelper.getRootCause(result.get(on)); appContext.log(t); sb.append("<tr><td>"); sb.append(on.getKeyProperty("name")); sb.append(":"); sb.append("</td><td>"); sb.append(t.getLocalizedMessage()); sb.append("</td></tr>"); } sb.append("</table>"); setMsgText(sb.toString()); JButton btn = new JButton("Close"); btn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { waitDialog.setVisible(false); } }); JPanel btnPanel = new JPanel(new FlowLayout()); btnPanel.add(btn); waitDialog.getContentPane().add(btnPanel, BorderLayout.SOUTH); waitDialog.getRootPane().setWindowDecorationStyle(JRootPane.ERROR_DIALOG); waitDialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); Dimension size = waitDialog.getSize(); waitDialog.pack(); waitDialog.setSize(size); } });
btnPanel.add(btn); waitDialog.getContentPane().add(btnPanel, BorderLayout.SOUTH); waitDialog.getRootPane().setWindowDecorationStyle(JRootPane.ERROR_DIALOG); waitDialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); Dimension size = waitDialog.getSize();
frame.setUndecorated(true); panel.add(scrollPane, BorderLayout.NORTH); frame.getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
@Override void postInitSwingComponent() { super.postInitSwingComponent(); JRootPane jrootpane = getSwingComponent(); if (jrootpane != null) { int deco = getRootPaneDecorationStyle(); jrootpane.setWindowDecorationStyle(deco); } }
private void createWaitDialog(String msg) { waitDialog = new JDialog(frame, frame.getTitle(), true); waitDialog.getRootPane().setWindowDecorationStyle(JRootPane.INFORMATION_DIALOG); waitDialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); XContainer panel = new XContainer(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = gbc.gridy = 0; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 1.0; gbc.insets = new Insets(5, 5, 5, 5); gbc.anchor = GridBagConstraints.NORTH; panel.add(waitMsgLabel = new XLabel("<html>" + msg + "</html>"), gbc); gbc.gridy++; gbc.fill = GridBagConstraints.BOTH; gbc.weighty = 1.0; panel.add(new XLabel(), gbc); // filler // waitMsgLabel.setFont((Font) appContext.getObject("message.label.font")); waitDialog.getContentPane().add(new JScrollPane(panel)); waitDialog.pack(); waitDialog.setSize(450, 150); WindowHelper.center(waitDialog, frame); waitDialog.addHierarchyListener(waitDialogListener = new WaitDialogListener()); }
protected JDialog createDialog(Component parent) throws HeadlessException { FileChooserUI ui = getUI(); String title = ui.getDialogTitle(this); putClientProperty(AccessibleContext.ACCESSIBLE_DESCRIPTION_PROPERTY, title); JDialog dialog; Window window = getWindowForComponent(parent); if (window instanceof Frame) { dialog = new JDialog((Frame)window, title, true); } else { dialog = new JDialog((Dialog)window, title, true); } dialog.setComponentOrientation(this.getComponentOrientation()); Container contentPane = dialog.getContentPane(); contentPane.setLayout(new BorderLayout()); contentPane.add(this, BorderLayout.CENTER); if (JDialog.isDefaultLookAndFeelDecorated()) { boolean supportsWindowDecorations = UIManager.getLookAndFeel().getSupportsWindowDecorations(); if (supportsWindowDecorations) { dialog.getRootPane().setWindowDecorationStyle(JRootPane.FILE_CHOOSER_DIALOG); } } dialog.getRootPane().setDefaultButton(ui.getDefaultButton(this)); dialog.pack(); dialog.setLocationRelativeTo(parent); return dialog; }
private void initialize(String groupName) { setUndecorated(true); getRootPane().setWindowDecorationStyle(JRootPane.NONE); // TODO I am not sure null should be passed here, // maybe we should use our IDPersistentIdProvider dockingPort = new FloatingDockingPort(this, null); setContentPane(dockingPort); this.groupName = groupName; addComponentListener(BOUNDS_MONITOR); }
import javax.swing.*; import java.awt.*; import java.awt.event.*; class TransparentFrame2 extends JFrame { public TransparentFrame2() { setTitle("Transparent Frame Demo"); setUndecorated(true); getRootPane().setWindowDecorationStyle(JRootPane.FRAME); setBackground( new Color(0, 0, 0, 0) ); setSize(400,400); setDefaultCloseOperation(EXIT_ON_CLOSE); setVisible(true); } public static void main(String args[]) { new TransparentFrame2(); } }
dialog.getRootPane().setWindowDecorationStyle( JRootPane.NONE ); dialog.setLayout( new BorderLayout() );
private void init( boolean undecorated, WindowConfiguration configuration ){ if( undecorated ){ frame.setUndecorated( true ); frame.getRootPane().setWindowDecorationStyle( JRootPane.NONE ); } frame.setDefaultCloseOperation( JDialog.DO_NOTHING_ON_CLOSE ); frame.addWindowListener( new WindowAdapter(){ @Override public void windowClosing( WindowEvent e ){ fireWindowClosing(); } }); init( frame, frame.getContentPane(), configuration, undecorated ); boolean translucency = false; if( configuration.isTransparent() ){ translucency = Workarounds.getDefault().setTranslucent( frame ); } if( !translucency && configuration.getShape() != null ){ setShape( frame, configuration.getShape() ); } }
private void init( boolean undecorated, WindowConfiguration configuration ){ if( undecorated ){ frame.setUndecorated( true ); frame.getRootPane().setWindowDecorationStyle( JRootPane.NONE ); } frame.setDefaultCloseOperation( JDialog.DO_NOTHING_ON_CLOSE ); frame.addWindowListener( new WindowAdapter(){ @Override public void windowClosing( WindowEvent e ){ fireWindowClosing(); } }); init( frame, frame.getContentPane(), configuration, undecorated ); boolean translucency = false; if( configuration.isTransparent() ){ translucency = Workarounds.getDefault().setTranslucent( frame ); } if( !translucency && configuration.getShape() != null ){ setShape( frame, configuration.getShape() ); } }
frame.getRootPane().setWindowDecorationStyle(JRootPane.FRAME); frame.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
private void initComponents() { toolTip = new JToolTip(); owner.addComponentListener(locationAdapter); owner.addAncestorListener(locationAdapter); getRootPane().setWindowDecorationStyle(JRootPane.NONE); // Just in case... setFocusable(false); // Just in case... setFocusableWindowState(false); setContentPane(toolTip); }
private void init( boolean undecorated, WindowConfiguration configuration ){ if( undecorated ){ dialog.setUndecorated( true ); dialog.getRootPane().setWindowDecorationStyle( JRootPane.NONE ); } dialog.setDefaultCloseOperation( JDialog.DO_NOTHING_ON_CLOSE ); dialog.setModal( false ); dialog.addWindowListener( new WindowAdapter(){ @Override public void windowClosing( WindowEvent e ){ fireWindowClosing(); } }); boolean translucency = false; if( configuration.isTransparent() ){ JPanel panel = new JPanel(); panel.setOpaque( false ); dialog.setContentPane( panel ); translucency = Workarounds.getDefault().setTranslucent( dialog ); } init( dialog, dialog.getContentPane(), configuration, undecorated ); if( !translucency && configuration.getShape() != null ){ setShape( dialog, configuration.getShape() ); } }
/** * Initializes the components of the tooltip window. */ private void initComponents() { // Avoid warning on Mac OS X when changing the alpha getRootPane().putClientProperty("apple.awt.draggableWindowBackground", Boolean.FALSE); toolTip = new JToolTip(); toolTip.addMouseListener(new TransparencyAdapter()); owner.addComponentListener(locationAdapter); owner.addAncestorListener(locationAdapter); getRootPane().setWindowDecorationStyle(JRootPane.NONE); // Just in case... setFocusable(false); // Just in case... setFocusableWindowState(false); setContentPane(toolTip); pack(); // Seems to help for the very first setVisible(true) when window transparency is on }