public static void main(String[] args) { /* Use an appropriate Look and Feel */ try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); // UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch (UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } catch (IllegalAccessException ex) { ex.printStackTrace(); } catch (InstantiationException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } /* Turn off metal's use of bold fonts */ UIManager.put("swing.boldMetal", Boolean.FALSE); // Schedule a job for the event-dispatching thread: // adding TrayIcon. SwingUtilities.invokeLater( new Runnable() { public void run() { weather = new Wetter(); createAndShowGUI(); } }); }
public static void main(String[] args) { /*use an appropriate look and feel*/ try { /* UImanager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); UImanager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); */ UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch (UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } catch (IllegalAccessException ex) { ex.printStackTrace(); } catch (InstantiationException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } /*turn off metal's use of bold fonts*/ UIManager.put("swing.boldMetal", Boolean.FALSE); /* Schedule a job for the event dispatch thread creating and showing this application's GUI */ javax.swing.SwingUtilities.invokeLater( new Runnable() { public void run() { createAndShowGUI(); } }); }
public static void main(String[] args) { // Get the System Look and Feel try { // UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } // Instantiate the Gooseget main frame GooseGet ggget = new GooseGet(); ggget.setSize(900, 600); // Keep in the middle of the Screen Dimension screenSize1 = Toolkit.getDefaultToolkit().getScreenSize(); Dimension swinSize = ggget.getSize(); swinSize.height = ((swinSize.height > screenSize1.height) ? screenSize1.height : swinSize.height); swinSize.width = ((swinSize.width > screenSize1.width) ? screenSize1.width : swinSize.width); ggget.setLocation( (screenSize1.width - swinSize.width) / 2, (screenSize1.height - swinSize.height) / 2); ggget.setVisible(true); }
private void configureUI() { // UIManager.put("ToolTip.hideAccelerator", Boolean.FALSE); Options.setDefaultIconSize(new Dimension(18, 18)); Options.setUseNarrowButtons(settings.isUseNarrowButtons()); Options.setTabIconsEnabled(settings.isTabIconsEnabled()); UIManager.put(Options.POPUP_DROP_SHADOW_ENABLED_KEY, settings.isPopupDropShadowEnabled()); // Swing Settings LookAndFeel selectedLaf = settings.getSelectedLookAndFeel(); // Work around caching in MetalRadioButtonUI JRadioButton radio = new JRadioButton(); radio.getUI().uninstallUI(radio); JCheckBox checkBox = new JCheckBox(); checkBox.getUI().uninstallUI(checkBox); try { UIManager.setLookAndFeel(selectedLaf); SwingUtilities.updateComponentTreeUI(this); } catch (UnsupportedLookAndFeelException uslafe) { System.out.println("UnsupportedLookAndFeelException: " + uslafe.getMessage()); } catch (Exception e) { System.out.println("Can't change L&F: " + e); } // // FensterIcon // String IconLocation = ResourceManager.getString("icon.IconImage"); // System.out.println("[i] set IconImage: " + // getClass().getResource(IconLocation).toString()); // setIconImage( new // ImageIcon(getClass().getResource(IconLocation)).getImage()); }
private static void setLookAndFeel(String os) { if (os == null) { os = System.getProperty("os.name"); } os = os.trim().toLowerCase(); try { if (os.contains("windows")) { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } else if (os.contains("mac")) { UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel"); } else if (os.contains("javametal")) { UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } else if (os.contains("weblookandfeel")) { WebLookAndFeel.install(); } else { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } } catch (ClassNotFoundException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (InstantiationException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IllegalAccessException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (UnsupportedLookAndFeelException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } }
/** * Main method of SensorSimulatorMain class. * * @param args , String[] arguments used to run this GUI. */ public static void main(String[] args) { try { // set nimbus theme UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); // modify some colors from the theme UIManager.put("control", Global.BACK); UIManager.put("text", Global.TEXT); UIManager.put("scrollbar", Global.TEXT); UIManager.put("nimbusBlueGrey", Global.BUTTON); UIManager.put("nimbusBase", Global.TAB); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } // Schedule a job for the event-dispatching thread: // creating and showing this application's GUI. final SensorSimulatorMain mainSensorSimulator = new SensorSimulatorMain(); new Global().initGlobal(); javax.swing.SwingUtilities.invokeLater( new Runnable() { @Override public void run() { mainSensorSimulator.createAndShowGUI(); } }); }
public static void main(String[] args) { // com.sun.java.swing.plaf.gtk. try { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } // UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { // TODO Auto-generated catch block e.printStackTrace(); } board = new Board(19); new UiFrame(board); }
private void init() { btnOpen = new JButton("Open"); btnOpen.setSize(100, 50); textArea = new JTextArea("sd"); textArea.setSize(200, 100); textArea.setDragEnabled(true); btnOpen.addActionListener(new OpenAction()); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException e) { // TODO 自动生成 catch 块 e.printStackTrace(); } catch (InstantiationException e) { // TODO 自动生成 catch 块 e.printStackTrace(); } catch (IllegalAccessException e) { // TODO 自动生成 catch 块 e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { // TODO 自动生成 catch 块 e.printStackTrace(); } Container container = getContentPane(); GroupLayout groupLayout = new GroupLayout(container); container.setLayout(groupLayout); groupLayout.setAutoCreateContainerGaps(true); groupLayout.setAutoCreateGaps(true); // 左对齐 GroupLayout.ParallelGroup p1 = groupLayout.createParallelGroup(GroupLayout.Alignment.LEADING); p1.addComponent(btnOpen); p1.addComponent(textArea); // 水平 groupLayout.setHorizontalGroup(groupLayout.createSequentialGroup().addGroup(p1)); GroupLayout.ParallelGroup v1 = groupLayout.createParallelGroup(GroupLayout.Alignment.LEADING); v1.addComponent(btnOpen); GroupLayout.ParallelGroup v2 = groupLayout.createParallelGroup(GroupLayout.Alignment.LEADING); v2.addComponent(textArea); GroupLayout.SequentialGroup vGroup = groupLayout.createSequentialGroup(); vGroup.addGroup(v1).addGroup(v2); // 垂直 groupLayout.setVerticalGroup(groupLayout.createSequentialGroup().addGroup(vGroup)); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setTitle("通讯录"); setSize(300, 500); Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); setLocation((dimension.width - getSize().width) / 2, (dimension.height - getSize().height) / 3); // pack(); setVisible(true); }
private static void prepare() { if (!SystemUtil.getModulesDirectory().exists()) SystemUtil.getModulesDirectory().mkdirs(); WebLookAndFeel feel = new WebLookAndFeel(); try { UIManager.setLookAndFeel(feel); } catch (UnsupportedLookAndFeelException e) { DebugUtils.error(e.getMessage()); e.printStackTrace(); } }
private void setSystemLookAndFeel() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } }
public static void main(String[] args) { /* Use an appropriate Look and Feel */ try { // UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch (UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } catch (IllegalAccessException ex) { ex.printStackTrace(); } catch (InstantiationException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } /* Turn off metal's use of bold fonts */ UIManager.put("swing.boldMetal", Boolean.FALSE); final GUI_QPDownloader frame = new GUI_QPDownloader("Thapar Question Paper Downloader"); // Schedule a job for the event dispatch thread: // creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater( new Runnable() { public void run() { // Create and set up the window. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setJMenuBar((new MyJMenuBar(frame)).menuBar); // Display the window. // frame.pack(); // Set up the content pane. frame.addLoadingMessage(frame.getContentPane()); frame.pack(); frame.setSize(new Dimension((int) (frame.getSize().getWidth()), 300)); frame.setResizable(false); frame.setVisible(true); frame.update(frame.getGraphics()); } }); // Schedule a job for the event dispatch thread: // creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater( new Runnable() { public void run() { frame.addComponentsToPane(frame.getContentPane()); frame.setResizable(true); frame.setExtendedState(JFrame.MAXIMIZED_BOTH); } }); }
/** Create the frame. */ public Main() { // DAO pracownikDao = new PracownikDAO(); wlascicielDao = new WlascicielDAO(); //// http://thebadprogrammer.com/swing-uimanager-keys/ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); UIManager.put("Table.selectionBackground", Color.ORANGE); UIManager.put("Table.selectionForeground", Color.BLACK); UIManager.put("TextField.background", Color.ORANGE); } catch (ClassNotFoundException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (InstantiationException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IllegalAccessException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (UnsupportedLookAndFeelException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 1230, 589); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(new GridLayout(1, 0, 0, 0)); tabbedPane = new JTabbedPane(JTabbedPane.TOP); contentPane.add(tabbedPane); JPanel MenuTab = new JPanel(); tabbedPane.addTab("Menu", null, MenuTab, null); MenuTab.setLayout(null); JLabel lblWitaj = new JLabel("Witaj!"); lblWitaj.setBounds(358, 157, 46, 14); MenuTab.add(lblWitaj); zakladkaPracownicy(); zakladkaWlasciciele(); zakladkaBloki(); }
/** * Launch the application * * @param args */ public static void main(String args[]) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); RenameView view = new RenameView(); } catch (ClassNotFoundException classNotFoundException) { classNotFoundException.printStackTrace(); } catch (InstantiationException instantiationException) { instantiationException.printStackTrace(); } catch (IllegalAccessException illegalAccessException) { illegalAccessException.printStackTrace(); } catch (UnsupportedLookAndFeelException unsupportedLookAndFeelException) { unsupportedLookAndFeelException.printStackTrace(); } }
public UpdateAssetGUI() { try { PluginMgrClient.init(); mclient = new MasterMgrClient(); queue = new QueueMgrClient(); plug = PluginMgrClient.getInstance(); log = LogMgr.getInstance(); pAssetManager = new TreeMap<String, AssetInfo>(); project = "lr"; charList = new TreeMap<String, String>(); setsList = new TreeMap<String, String>(); propsList = new TreeMap<String, String>(); potentialUpdates = new TreeSet<String>(); pSubstituteFields = new TreeMap<String, LinkedList<JBooleanField>>(); /* load the look-and-feel */ { try { SynthLookAndFeel synth = new SynthLookAndFeel(); synth.load( LookAndFeelLoader.class.getResourceAsStream("synth.xml"), LookAndFeelLoader.class); UIManager.setLookAndFeel(synth); } catch (java.text.ParseException ex) { log.log( LogMgr.Kind.Ops, LogMgr.Level.Severe, "Unable to parse the look-and-feel XML file (synth.xml):\n" + " " + ex.getMessage()); System.exit(1); } catch (UnsupportedLookAndFeelException ex) { log.log( LogMgr.Kind.Ops, LogMgr.Level.Severe, "Unable to load the Pipeline look-and-feel:\n" + " " + ex.getMessage()); System.exit(1); } } /* application wide UI settings */ { JPopupMenu.setDefaultLightWeightPopupEnabled(false); ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); } } catch (PipelineException ex) { ex.printStackTrace(); } // end try/catch } // end constructor
public static void useScreenMenuBar() { try { System.setProperty("apple.laf.useScreenMenuBar", "true"); System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Application L.L.L."); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException e) { logger.fatal("ClassNotFoundException: " + e.getMessage()); } catch (InstantiationException e) { logger.fatal("InstantiationException: " + e.getMessage()); } catch (IllegalAccessException e) { logger.fatal("IllegalAccessException: " + e.getMessage()); } catch (UnsupportedLookAndFeelException e) { logger.fatal("UnsupportedLookAndFeelException: " + e.getMessage()); } }
public static void main(String args[]) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } new Delete(); }
/** UIManager.setLookAndFeel() method to set the look and feel */ public static void changeAppearance() { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
public static void main(String[] args) { JFrame.setDefaultLookAndFeelDecorated(true); SubstanceLookAndFeel.setSkin(new ModerateSkin()); SubstanceLookAndFeel.setSkin( "org.pushingpixels.substance.api.skin.SubstanceModerateLookAndFeel"); try { UIManager.setLookAndFeel(new SubstanceModerateLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } new Principal(); }
/** Launch the application. */ public static void main(String[] args) { giorniArray = new String[31]; anniArray = new String[50]; oreArray = new String[24]; minutiArray = new String[60]; for (int i = 1; i < 32; i++) { giorniArray[i - 1] = Integer.toString(i); } int j = 0; for (int i = 2000; i < 2050; i++) { anniArray[j++] = Integer.toString(i); } for (int i = 0; i < 60; i++) { minutiArray[i] = Integer.toString(i); } for (int i = 0; i < 24; i++) { oreArray[i] = Integer.toString(i); } try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } EventQueue.invokeLater( new Runnable() { public void run() { try { FrontEnd1 window = new FrontEnd1(); window.frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); }
public GAPConnectDialog(Frame frame) { super(frame, "网络连接", false); try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch (ClassNotFoundException e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } catch (InstantiationException e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } catch (IllegalAccessException e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } this.frame = frame; textArea = new JTextArea(); textArea.setBackground(Color.white); textArea.setLineWrap(true); textArea.setEditable(false); textArea.setFont(ComponentStyle.defaultFont); textArea.setAlignmentX(0.5f); textArea.setBorder(BorderFactory.createEmptyBorder()); jspane = new JScrollPane(textArea); jsbar = jspane.getVerticalScrollBar(); cancel = new GAPButton("取消"); cancel.setFont(ComponentStyle.defaultFont); reconnect = new GAPButton("重新连接"); reconnect.setFont(ComponentStyle.defaultFont); confirm = new GAPButton("确定"); confirm.setFont(ComponentStyle.defaultFont); cancelConnect = new GAPButton("取消连接"); cancelConnect.setFont(ComponentStyle.defaultFont); JPanel jp = new JPanel(); jp.setBackground(Color.white); jp.setLayout(new FlowLayout(FlowLayout.CENTER, 10, 5)); jp.add(reconnect); jp.add(confirm); jp.add(cancel); add(jspane, BorderLayout.CENTER); add(jp, BorderLayout.SOUTH); setLocationRelativeTo(frame); setSize(WIDTH, HEIGHT); }
protected void initWithSystemUI() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
/** @throws java.lang.Exception */ @Before public void setUp() throws Exception { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException nfe) { nfe.printStackTrace(); } catch (javax.swing.UnsupportedLookAndFeelException ulfe) { ulfe.printStackTrace(); } }
public static void newIDEWindow() { try { System.getProperty("com.apple.laf.useScreenMenuBar", "true"); System.getProperty("com.apple.mrj.application.apple.menu.about.name", "IDE"); UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } new IDEWindow("IDE"); }
static { String os = System.getProperty("os.name").toLowerCase(); if (os.indexOf("mac") >= 0) { LABEL_FONT = new Font("Arial Narrow", Font.BOLD, 12); } try { // sets the look and feel of the ARO executing environment setLookAndFeel(getSystemLookAndFeelClassName()); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } }
private void setLookAndFeel() { String laf = props.getProperty(Property.LAF); final SynthLookAndFeel slaf = new SynthLookAndFeel(); try { // Check if Synth is the chosen one. if ("Synth".equalsIgnoreCase(laf)) { slaf.load( FileUtil.getStreamSource("file:src/main/resources/synthGUI.xml").getInputStream(), UserControl.class); UIManager.setLookAndFeel(slaf); return; } // Otherwise see what is possible, and choose the one from the // properties file for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if (laf.equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); return; } } } catch (final ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (final UnsupportedLookAndFeelException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (final NullPointerException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
/** @param args */ public static void main(final String[] args) { try { Properties props = new Properties(); props.put("logoString", ""); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException e1) { e1.printStackTrace(); } catch (InstantiationException e1) { e1.printStackTrace(); } catch (IllegalAccessException e1) { e1.printStackTrace(); } catch (UnsupportedLookAndFeelException e1) { e1.printStackTrace(); } PhysicsUI pui = new PhysicsUI(); pui.init(); }
/** @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // <editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { logger.error(ex.getMessage()); } catch (InstantiationException ex) { logger.error(ex.getMessage()); } catch (IllegalAccessException ex) { logger.error(ex.getMessage()); } catch (javax.swing.UnsupportedLookAndFeelException ex) { logger.error(ex.getMessage()); } // </editor-fold> /* Create and display the dialog */ java.awt.EventQueue.invokeLater( new Runnable() { public void run() { ConfirmDialog dialog = new ConfirmDialog(new javax.swing.JFrame(), true, "", "", "", ""); dialog.addWindowListener( new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); }
/** Create the frame. */ public OrderForm() { try { UIManager.setLookAndFeel(new NimbusLookAndFeel()); } catch (UnsupportedLookAndFeelException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } setAlwaysOnTop(true); setTitle("Bill"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 366, 301); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JLabel labelOK = new JLabel("Ok,your foods are on the way!"); labelOK.setHorizontalAlignment(SwingConstants.CENTER); labelOK.setBounds(45, 46, 263, 16); contentPane.add(labelOK); JButton btnExit = new JButton("Exit"); btnExit.addMouseListener( new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { System.exit(1); } }); btnExit.setBounds(125, 202, 117, 29); contentPane.add(btnExit); panel = new JPanel(); panel.setBorder( new TitledBorder(null, "Bill", TitledBorder.LEADING, TitledBorder.TOP, null, null)); panel.setBounds(65, 74, 250, 116); contentPane.add(panel); panel.setLayout(new BorderLayout(0, 0)); }
public InalFileChooser(File f) { super(f); // new InalLookAndFeel().apply(this); try { // UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); // UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel"); // UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); // UIManager.setLookAndFeel("javax.swing.plaf.mac.MacLookAndFeel.Mac"); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); SwingUtilities.updateComponentTreeUI(this); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } }
public static void main(String[] args) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } SwingUtilities.invokeLater( new Runnable() { @Override public void run() { new Test().initUI(); } }); }