public static void main(String... args) { JFrame f = new JFrame(); f.setSize(600, 400); f.setVisible(true); MageFloatPane fp = new MageFloatPane(); fp.setCard("Card"); MageRoundPane popupContainer = new MageRoundPane(); popupContainer.setLayout(null); popupContainer.add(fp); //popupContainer.setVisible(false); popupContainer.setBounds(0, 0, 320 + 80, 201 + 80); JDialog floatOnParent = new JDialog(f, false); floatOnParent.setUndecorated(true); floatOnParent.getContentPane().add(popupContainer); floatOnParent.setBounds(300, 100, 300, 200); floatOnParent.setVisible(true); } }
/** * Sets whether the dialog has a decoration or not. * @param undecorated whether to decorate or not * @see JDialog#setUndecorated(boolean) */ public void setUndecorated( boolean undecorated ){ dialog.setUndecorated( undecorated ); }
/** * Sets whether the dialog has a decoration or not. * @param undecorated whether to decorate or not * @see JDialog#setUndecorated(boolean) */ public void setUndecorated( boolean undecorated ){ dialog.setUndecorated( undecorated ); }
JDialog dialog = new JDialog(...); dialog.setUndecorated(true);
JDialog dialog = new JDialog(); dialog.setUndecorated(true);
JDialog dialog = new JDialog(); dialog.setUndecorated(true); JLabel label = new JLabel( new ImageIcon(...) ); dialog.add( label ); dialog.pack(); dialog.setVisible(true);
private void checkUndecorated(RootPaneContainer topContainer) { if (UIManager.getLookAndFeel().getClass().getName().startsWith("com.jtattoo.plaf") || UIManager.getLookAndFeel().getClass().getName().startsWith("de.javasoft.plaf.synthetica")) { if (topContainer instanceof JFrame) { ((JFrame) topContainer).setUndecorated(true); } else if (topContainer instanceof JDialog) { ((JDialog) topContainer).setUndecorated(true); } } }
public static void main(String[] args) throws InterruptedException { JDialog frame = new JDialog((Frame) null, "MC Immovable"); frame.setUndecorated(true); JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createEtchedBorder(Color.GREEN, Color.RED)); panel.add(new JLabel("You can't move this")); frame.setContentPane(panel); frame.pack(); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); frame.setVisible(true); }
JDialog dialog=new JDialog(frmInstance); dialog.setUndecorated(true); dialog.setVisible(true); dialog.setSize(200,100);
JDialog dialog = new JDialog(); dialog.setUndecorated(true); dialog.getRootPane().setWindowDecorationStyle(JRootPane.PLAIN_DIALOG);
/** * Constructs a ProgressDialog. A ProgressDialog contains a message and an optional sub-message. */ public ProgressDialog() { dlg.setUndecorated(true); JPanel contentPane = new JPanel(); contentPane.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.LIGHT_GRAY)); dlg.setContentPane(contentPane); contentPane.setLayout(new BorderLayout()); contentPane.add(view.asJComponent(), BorderLayout.NORTH); }
final JDialog dialog = new JDialog(); dialog.setUndecorated(true); dialog.setSize(0, 0); dialog.setModal(true); dialog.pack();
/** * Constructs a ProgressDialog. A ProgressDialog contains a message and an optional sub-message. */ public ProgressDialog() { dlg.setUndecorated(true); JPanel contentPane = new JPanel(); contentPane.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.LIGHT_GRAY)); dlg.setContentPane(contentPane); contentPane.setLayout(new BorderLayout()); contentPane.add(view.asJComponent(), BorderLayout.NORTH); }
JDialog dlg = new JDialog(); // Remove dialog decorations to make it look like a splashscreen. dlg.setUndecorated(true); dlg.setModal(true); dlg.setLayout(new BorderLayout()); // Load image. ImageIcon img = new ImageIcon(getClass().getResource("/foo/bar/splash.png"); // Add image to center of dialog. dlg.add(img, BorderLayout.CENTER); dlg.setLocationRelativeTo(null); dlg.setVisible(true); // ... Perform application initialisation here. // Initialisation complete so hide dialog. dlg.setVisible(false); dlg = null;
protected void showSplashScreen() throws MalformedURLException { dialog = new JDialog((Frame) null); dialog.setModal(false); dialog.setUndecorated(true); URL resource = SwingInspectionFrame.class.getClassLoader().getResource("Spalsh.png"); ImageIcon image = new ImageIcon(resource); Image scaledInstance = image.getImage().getScaledInstance(500, 300, Image.SCALE_SMOOTH); JLabel background = new JLabel(new ImageIcon(scaledInstance)); background.setLayout(new BorderLayout()); dialog.add(background); progress = new JProgressBar(); background.add(progress, BorderLayout.SOUTH); dialog.pack(); dialog.setLocationRelativeTo(null); dialog.setVisible(true); }
JDialog jDialog = new JDialog(); jDialog.setLayout(new GridBagLayout()); jDialog.add(new JLabel("Please wait...")); jDialog.setMinimumSize(new Dimension(150, 50)); jDialog.setResizable(false); jDialog.setModal(false); jDialog.setUndecorated(true); jDialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); jDialog.setLocationRelativeTo(null); jDialog.setVisible(true);
private void configuraLoader() { boolean usandoTemaDark = Configuracoes.getInstancia().isTemaDark(); String caminhoIcone = String.format("/br/univali/ps/ui/icones/%s/grande/load.gif", usandoTemaDark ? "Dark" : "Portugol"); Icon icone = new ImageIcon(getClass().getResource(caminhoIcone)); indicadorProgresso = new JDialog(); indicadorProgresso.setUndecorated(true); JPanel painel = new JPanel(); painel.setLayout(new BoxLayout(painel, BoxLayout.Y_AXIS)); painel.setBackground(ColorController.FUNDO_CLARO); painel.add(new JLabel(icone, JLabel.CENTER)); JLabel instalando = new JLabel("Baixando...", JLabel.CENTER); instalando.setForeground(ColorController.COR_LETRA); instalando.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); painel.add(instalando); indicadorProgresso.add(painel); indicadorProgresso.setModalityType(Dialog.ModalityType.APPLICATION_MODAL); indicadorProgresso.pack(); indicadorProgresso.setLocationRelativeTo(Lancador.getInstance().getJFrame()); }
@ScriptFunction public void setUndecorated(boolean aValue) { undecorated = aValue; if (surface instanceof JDialog) { ((JDialog) surface).setUndecorated(undecorated); } if (surface instanceof JInternalFrame) { //((JInternalFrame) surface).setUndecorated(undecorated); } if (surface instanceof JFrame) { ((JFrame) surface).setUndecorated(undecorated); } }
private void init(){ autoSuggestProvider = new DefaultAutoSuggestProvider(); lastWord = ""; regular = getFont(); busy = new Font(getFont().getName(), Font.ITALIC, getFont().getSize()); suggestions = new Vector<String>(); defaultText = DEFAULT_TEXT; dialog = new JDialog(); dialog.setUndecorated(true); dialog.setFocusableWindowState(false); dialog.setFocusable(false); initSuggestionList(); }
public void showInDialog(Frame ui, boolean undecorated) { JDialog f = new JDialog(ui, true); f.add(this); if (iconPath != null) { f.setIconImage(SwingUtil.createIcon(iconPath).getImage()); } f.setResizable(false); f.setSize(550, 450); f.setUndecorated(undecorated); JRootPane rootPane = f.getRootPane(); rootPane.setDefaultButton(close); rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "close"); rootPane.getActionMap().put("close", closeAction); SwingUtil.center(ui, f); f.setVisible(true); }