b.setFocusable(false); panel.add(b, constraints); dialog.setUndecorated(true); dialog.setSize(300, 100); dialog.setLocation(screenSize.width - dialog.getWidth(),
setUndecorated(true); setSize(300, 100);
splash.setUndecorated(true);
public void setUndecorated( boolean b ) { if( d != null ) { d.setUndecorated( b ); } else if( f != null ) { f.setUndecorated( b ); } else if( jif != null ) { // System.out.println( "ERROR: borderless property not supported by internal frames!" ); // jif.getRootPane().setWindowDecorationStyle( JRootPane.NONE ); jif.setUI( new EmptyInternalFrameUI( jif )); } else { throw new IllegalStateException( "setUndecorated() is not supported by this window type" ); } }
import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JDialog; import javax.swing.Timer; public class Main { public static void main(String[] args) { final JDialog dlg = new JDialog(); dlg.setBounds(100, 100, 200, 100); dlg.setUndecorated(true); dlg.setVisible(!dlg.isVisible()); Timer showTimer = new Timer(3000, new ActionListener() { @Override public void actionPerformed(ActionEvent e) { dlg.setVisible(!dlg.isVisible()); } }); showTimer.start(); } }
super(new JFrame(), true); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); setUndecorated(true); setLayout(new FlowLayout(FlowLayout.CENTER)); add(messageLbl);
dialog.setUndecorated(true); dialog.setTitle("Testing"); dialog.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
dialog.setUndecorated(true); dialog.pack(); dialog.setLocationRelativeTo(null);
import java.awt.event.*; import javax.swing.*; public class TestSwing { public static void main(String[] args) throws Exception { JFrame frame = new JFrame("Parent"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(800, 600); frame.setVisible(true); final JDialog dialog = new JDialog(frame, "Child", true); dialog.setSize(300, 200); dialog.setLocationRelativeTo(frame); JButton button = new JButton("Button"); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { dialog.dispose(); } }); dialog.add(button); dialog.setUndecorated(true); dialog.setVisible(true); } }
setUndecorated(true); setFocusableWindowState(false); add(new JScrollPane(new JTextArea(20, 40)));
this.setUndecorated(true); this.setAlwaysOnTop(true); this.setFocusableWindowState(true);
final JDialog dlg = (JDialog) SwingUtilities.windowForComponent(he.getChangedParent()); if (dlg != null && !dlg.isUndecorated()) { dlg.setUndecorated(true);
frame.setSize(320, 240); frame.setContentPane(new JLabel(new ImageIcon("H:\\walk.gif"))); frame.setUndecorated(true); frame.setResizable(false); frame.setLocationRelativeTo(null);
dialog.setUndecorated(true); dialog.setLayout(new BorderLayout()); dialog.add(op);
setUndecorated(true); setFocusableWindowState(false); add(new JScrollPane(new JTextArea(20, 40)));
dialog.setUndecorated(true); dialog.setBackground(new Color(0, 0, 0, 0)); dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
dialog.setUndecorated(true); dialog.add( new JButton("Dummy Button") ); dialog.pack();
d.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); d.add(new JCheckBox("Something")); d.setUndecorated(true); d.pack();
obj.setUndecorated(undecorated);
private void makeWindow() { dialog = new java.awt.Dialog(IJ.getInstance(), "Loading...", false); dialog.setUndecorated(true); bytes = new Label("Loaded: 0 bytes "); speed = new Label("Speed: 0 bytes/s "); time = new Label ("Elapsed time: 0 s "); dialog.setLayout(new GridLayout(3,1)); dialog.addWindowListener(new java.awt.event.WindowAdapter() { public void windowDeactivated(java.awt.event.WindowEvent we) { dialog.toFront(); } }); dialog.add(time); dialog.add(bytes); dialog.add(speed); java.awt.Dimension screen = dialog.getToolkit().getScreenSize(); dialog.pack(); dialog.setLocation(screen.width/2 - dialog.getWidth()/2, screen.height/2 - dialog.getHeight()/2); //dialog.setVisible(true); } Monitor(Connection con) {