List of usage examples for javax.swing JFrame setDefaultLookAndFeelDecorated
public static void setDefaultLookAndFeelDecorated(boolean defaultLookAndFeelDecorated)
JFrame
s should have their Window decorations (such as borders, widgets to close the window, title...) provided by the current look and feel. From source file:com.qawaa.gui.PointAnalysisGUI.java
/** * Auto-generated main method to display this JFrame *///from www. j a v a2 s . c o m public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { PointAnalysisGUI inst = new PointAnalysisGUI(); inst.setLocationRelativeTo(null); inst.setVisible(true); inst.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JFrame.setDefaultLookAndFeelDecorated(true); FlowLayout flowLayout = new FlowLayout(); flowLayout.setAlignment(FlowLayout.LEFT); flowLayout.setAlignOnBaseline(true); inst.setTitle(PROGRAM_NAME + " [" + PROGRAM_VERSION + "] " + " - " + DefaultMessage.SOFT_NAME + " - " + DefaultMessage.COMPANY_NAME); { consoleScrollPane = new JScrollPane(); inst.getContentPane().add(consoleScrollPane, BorderLayout.CENTER); { consolePane = new JEditorPane(); consoleScrollPane.setViewportView(consolePane); consolePane.setText(""); setConsoleRight(); jConsole = new JConsole(System.out, consolePane); System.setOut(jConsole); System.setErr(jConsole); consolePane.setEditable(false); consolePane.addMouseListener(new MouseAdapter() { /* (non-Javadoc) * @see java.awt.event.MouseAdapter#mouseReleased(java.awt.event.MouseEvent) */ public void mouseReleased(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON3) { consolePane.add(consoleRight); consoleRight.show(e.getComponent(), e.getX(), e.getY()); } } }); } } { infoPanel = new JPanel(); inst.getContentPane().add(infoPanel, BorderLayout.SOUTH); infoPanel.setBorder(new LineBorder(new Color(0, 0, 0), 1, false)); infoPanel.setPreferredSize(new Dimension(784, 30)); infoPanel.setLayout(flowLayout); { { statusbar_count = new JTextPane(); infoPanel.add(statusbar_count); statusbar_count .setText(CONTEXT.getMessage("point.statusbar.count", null, Locale.CHINA)); statusbar_count.setBackground(null); statusbar_count.setEditable(false); } { statusbar_count_value = new JTextPane(); infoPanel.add(statusbar_count_value); statusbar_count_value.setText(String.valueOf(SCAN_COUNT)); statusbar_count_value.setBackground(null); statusbar_count_value.setEditable(false); statusbar_count_value.setEnabled(false); } { programPID = new JTextPane(); infoPanel.add(programPID); programPID.setText("PID:"); programPID.setBackground(null); programPID.setEditable(false); } { programPID_value = new JTextPane(); infoPanel.add(programPID_value); programPID_value.setText(JvmPid.getPID()); programPID_value.setBackground(null); programPID_value.setEditable(false); programPID_value.setEnabled(false); } { memory = new JTextPane(); infoPanel.add(memory); memory.setText(CONTEXT.getMessage("gobal.gui.memory", null, Locale.CHINA)); memory.setBackground(null); memory.setEditable(false); } { memory_value = new JTextPane(); infoPanel.add(memory_value); memory_value.setText("0KB"); memory_value.setBackground(null); memory_value.setEditable(false); memory_value.setEnabled(false); MemoryListener memory = new MemoryListener(memory_value); memory.start(); } { runtime = new JTextPane(); infoPanel.add(runtime); runtime.setText(CONTEXT.getMessage("gobal.gui.runtime", null, Locale.CHINA)); runtime.setBackground(null); runtime.setEditable(false); } { runtime_value = new JTextPane(); infoPanel.add(runtime_value); runtime_value.setText("NULL"); runtime_value.setBackground(null); runtime_value.setEditable(false); runtime_value.setEnabled(false); } } } { shortcut = new JPanel(); inst.getContentPane().add(shortcut, BorderLayout.NORTH); shortcut.setSize(784, 35); shortcut.setPreferredSize(new Dimension(784, 35)); shortcut.setBorder(new LineBorder(new Color(0, 0, 0), 1, false)); shortcut.setLayout(new BorderLayout()); { eventText = new JTextPane(); shortcut.add(eventText, BorderLayout.WEST); eventText.setText(CONTEXT.getMessage("point.event.name", null, Locale.CHINA) + ": "); eventText.setEditable(false); eventText.setEnabled(true); eventText.setBackground(null); eventText.setCaretColor(new Color(0, 0, 0)); } { eventTextField = new JTextField(); shortcut.add(eventTextField, BorderLayout.CENTER); eventTextField.setSize(500, 25); eventTextField.setText(""); eventTextField.setPreferredSize(new Dimension(500, 25)); eventTextField.setEditable(false); } { submit = new JButton(); shortcut.add(submit, BorderLayout.EAST); submit.setText(CONTEXT.getMessage("gobal.gui.button.run", null, Locale.CHINA)); submit.setSize(new Dimension(75, 25)); submit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { try { submitActionPerformed(evt); } catch (InterruptedException e) { e.printStackTrace(); } } }); } } } }); }
From source file:com.qawaa.gui.EventWebScanGUI.java
/** * Auto-generated main method to display this JFrame */// www .java 2 s . co m public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { EventWebScanGUI inst = new EventWebScanGUI(); inst.setLocationRelativeTo(null); inst.setVisible(true); inst.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JFrame.setDefaultLookAndFeelDecorated(true); FlowLayout flowLayout = new FlowLayout(); flowLayout.setAlignment(FlowLayout.LEFT); flowLayout.setAlignOnBaseline(true); inst.setTitle(PROGRAM_NAME + " [" + PROGRAM_VERSION + "] " + " - " + DefaultMessage.SOFT_NAME + " - " + DefaultMessage.COMPANY_NAME); { consoleScrollPane = new JScrollPane(); inst.getContentPane().add(consoleScrollPane, BorderLayout.CENTER); { consolePane = new JEditorPane(); consoleScrollPane.setViewportView(consolePane); consolePane.setText(""); setConsoleRight(); jConsole = new JConsole(System.out, consolePane); System.setOut(jConsole); System.setErr(jConsole); consolePane.setEditable(false); consolePane.addMouseListener(new MouseAdapter() { /* (non-Javadoc) * @see java.awt.event.MouseAdapter#mouseReleased(java.awt.event.MouseEvent) */ public void mouseReleased(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON3) { consolePane.add(consoleRight); consoleRight.show(e.getComponent(), e.getX(), e.getY()); } } }); } } { infoPanel = new JPanel(); inst.getContentPane().add(infoPanel, BorderLayout.SOUTH); infoPanel.setBorder(new LineBorder(new Color(0, 0, 0), 1, false)); infoPanel.setPreferredSize(new Dimension(784, 30)); infoPanel.setLayout(flowLayout); { { statusbar_count = new JTextPane(); infoPanel.add(statusbar_count); statusbar_count.setText( CONTEXT.getMessage("event.web.scan.statusbar.count", null, Locale.CHINA)); statusbar_count.setBackground(null); statusbar_count.setEditable(false); } { statusbar_count_value = new JTextPane(); infoPanel.add(statusbar_count_value); statusbar_count_value.setText(String.valueOf(SCAN_COUNT)); statusbar_count_value.setBackground(null); statusbar_count_value.setEditable(false); statusbar_count_value.setEnabled(false); } { programPID = new JTextPane(); infoPanel.add(programPID); programPID.setText("PID:"); programPID.setBackground(null); programPID.setEditable(false); } { programPID_value = new JTextPane(); infoPanel.add(programPID_value); programPID_value.setText(JvmPid.getPID()); programPID_value.setBackground(null); programPID_value.setEditable(false); programPID_value.setEnabled(false); } { memory = new JTextPane(); infoPanel.add(memory); memory.setText(CONTEXT.getMessage("gobal.gui.memory", null, Locale.CHINA)); memory.setBackground(null); memory.setEditable(false); } { memory_value = new JTextPane(); infoPanel.add(memory_value); memory_value.setText("0KB"); memory_value.setBackground(null); memory_value.setEditable(false); memory_value.setEnabled(false); MemoryListener memory = new MemoryListener(memory_value); memory.start(); } { runtime = new JTextPane(); infoPanel.add(runtime); runtime.setText(CONTEXT.getMessage("gobal.gui.runtime", null, Locale.CHINA)); runtime.setBackground(null); runtime.setEditable(false); } { runtime_value = new JTextPane(); infoPanel.add(runtime_value); runtime_value.setText("NULL"); runtime_value.setBackground(null); runtime_value.setEditable(false); runtime_value.setEnabled(false); } } } { shortcut = new JPanel(); inst.getContentPane().add(shortcut, BorderLayout.NORTH); shortcut.setSize(784, 35); shortcut.setPreferredSize(new Dimension(784, 35)); shortcut.setBorder(new LineBorder(new Color(0, 0, 0), 1, false)); shortcut.setLayout(new BorderLayout()); { eventText = new JTextPane(); shortcut.add(eventText, BorderLayout.WEST); eventText.setText(CONTEXT.getMessage("event.web.scan.name", null, Locale.CHINA) + ": "); eventText.setEditable(false); eventText.setEnabled(true); eventText.setBackground(null); eventText.setCaretColor(new Color(0, 0, 0)); } { eventTextField = new JTextField(); shortcut.add(eventTextField, BorderLayout.CENTER); eventTextField.setSize(500, 25); eventTextField.setText(""); eventTextField.setPreferredSize(new Dimension(500, 25)); eventTextField.setEditable(false); } { submit = new JButton(); shortcut.add(submit, BorderLayout.EAST); submit.setText(CONTEXT.getMessage("gobal.gui.button.run", null, Locale.CHINA)); submit.setSize(new Dimension(75, 25)); submit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { try { submitActionPerformed(evt); } catch (InterruptedException e) { e.printStackTrace(); } } }); } } } }); }
From source file:net.pandoragames.far.ui.swing.FindAndReplace.java
/** * The main method. Expects no arguments. * //w w w .j a v a 2s .c o m * @param args * not evaluated */ public static void main(String[] args) { if (FARConfig.getEffectiveJavaVersion() == 0) { // obscure jvm LogFactory.getLog(FindAndReplace.class) .warn("Java version could not be read. This may very well lead to unexpected crashes"); } else if (FARConfig.getEffectiveJavaVersion() < 5) { // won't work - // exit LogFactory.getLog(FindAndReplace.class) .error("FAR requires java 5 (1.5.x) or higher. Found 1." + FARConfig.getEffectiveJavaVersion()); System.exit(1); } else { LogFactory.getLog(FindAndReplace.class).debug("Running on java " + FARConfig.getEffectiveJavaVersion()); } JFrame.setDefaultLookAndFeelDecorated(SwingConfig.isMacOSX()); UIManager.put("Button.defaultButtonFollowsFocus", Boolean.TRUE); FindAndReplace far = new FindAndReplace(); far.configure(); far.init(); far.pack(); far.setVisible(true); // First time initialisation - speeds up the loading of the help views HelpView helpView = new HelpView(far, "About", "about.html", new Point(100, 100)); helpView.pack(); helpView.setVisible(false); if (args.length > 0 && SwingConfig.getEffectiveJavaVersion() > 5) { List<File> fileList = new ArrayList<File>(); for (String arg : args) { File file = new File(arg); if (file.exists()) fileList.add(file); } if (fileList.size() > 0) { far.fileImporter.importFiles(fileList); } } if (far.config.versionHasChanged()) { UpdateDialog updateWizzard = new UpdateDialog(far, far.config, far.componentRepository); if (updateWizzard.isUserInteractionRequired()) { updateWizzard.pack(); updateWizzard.setVisible(true); } else { updateWizzard.dispose(); } } }
From source file:lookandfeel.SynthDialog.java
public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { try { //Set the look and feel. initLookAndFeel();//from ww w . ja va2 s. c o m //Make sure we have nice window decorations. JFrame.setDefaultLookAndFeelDecorated(true); } catch (Exception ex) { ex.printStackTrace(); } new SynthDialog().setVisible(true); } }); }
From source file:lookandfeel.SynthDialog.java
public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { try { //Set the look and feel. initLookAndFeel();//from w w w .j a v a 2 s . c o m //Make sure we have nice window decorations. JFrame.setDefaultLookAndFeelDecorated(true); } catch (Exception ex) { ex.printStackTrace(); } new SynthDialog().setVisible(true); } }); }
From source file:com.streamhub.StreamHubLicenseGenerator.java
public static void main(String[] args) { JFrame.setDefaultLookAndFeelDecorated(true); SwingUtilities.invokeLater(new Runnable() { public void run() { try { UIManager.setLookAndFeel(new SubstanceGraphiteLookAndFeel()); } catch (Exception e) { System.out.println("Substance Graphite failed to initialize"); }//from w w w. java 2 s .c o m StreamHubLicenseGenerator w = new StreamHubLicenseGenerator(); w.setVisible(true); } }); }
From source file:clientesbac.frmConsultaClientes.java
/** * @param args the command line arguments *///from w w w . j a v a 2s .c o m public static void main(String args[]) { JFrame.setDefaultLookAndFeelDecorated(true); //Esta instruccion aplica el skin SubstanceLookAndFeel.setSkin("org.jvnet.substance.skin.NebulaSkin"); /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new frmConsultaClientes().setVisible(true); } }); }
From source file:Main.java
public void buildGUI() { JFrame.setDefaultLookAndFeelDecorated(true); JFrame f = new JFrame(); f.setResizable(false);// ww w .j a va2s. c om removeMinMaxClose(f); JPanel p = new JPanel(new GridBagLayout()); JButton btn = new JButton("Exit"); p.add(btn, new GridBagConstraints()); f.getContentPane().add(p); f.setSize(400, 300); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setVisible(true); btn.addActionListener(e -> System.exit(0)); }
From source file:net.erdfelt.android.sdkfido.ui.utils.UIUtils.java
public static void setDefaultLookAndFeel() { try {/*ww w .j a va 2 s . c o m*/ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { log.warn("Unable to set System Look and Feel.", e); } JFrame.setDefaultLookAndFeelDecorated(true); }
From source file:net.erdfelt.android.sdkfido.ui.utils.UIUtils.java
public static void setJavaLookAndFeel() { try {/*w w w. j av a2 s . c om*/ UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch (Exception e) { log.warn("Unable to set Java Look and Feel.", e); } JFrame.setDefaultLookAndFeelDecorated(true); }