List of usage examples for javax.swing UIManager put
public static Object put(Object key, Object value)
From source file:appmain.AppMain.java
public static void main(String[] args) { try {//from www . j av a 2 s .c o m UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); UIManager.put("OptionPane.yesButtonText", "Igen"); UIManager.put("OptionPane.noButtonText", "Nem"); } catch (Exception ex) { ex.printStackTrace(); } try { AppMain app = new AppMain(); app.init(); File importFolder = new File(DEFAULT_IMPORT_FOLDER); if (!importFolder.isDirectory() || !importFolder.exists()) { JOptionPane.showMessageDialog(null, "Az IMPORT mappa nem elrhet!\n" + "Ellenrizze az elrsi utat s a jogosultsgokat!\n" + "Mappa: " + importFolder.getAbsolutePath(), "Informci", JOptionPane.INFORMATION_MESSAGE); return; } File exportFolder = new File(DEFAULT_EXPORT_FOLDER); if (!exportFolder.isDirectory() || !exportFolder.exists()) { JOptionPane.showMessageDialog(null, "Az EXPORT mappa nem elrhet!\n" + "Ellenrizze az elrsi utat s a jogosultsgokat!\n" + "Mappa: " + exportFolder.getAbsolutePath(), "Informci", JOptionPane.INFORMATION_MESSAGE); return; } List<File> xmlFiles = app.getXMLFiles(importFolder); if (xmlFiles == null || xmlFiles.isEmpty()) { JOptionPane.showMessageDialog(null, "Nincs beolvasand XML fjl!\n" + "Mappa: " + importFolder.getAbsolutePath(), "Informci", JOptionPane.INFORMATION_MESSAGE); return; } StringBuilder fileList = new StringBuilder(); xmlFiles.stream().forEach(xml -> fileList.append("\n").append(xml.getName())); int ret = JOptionPane.showConfirmDialog(null, "Beolvassra elksztett fjlok:\n" + fileList + "\n\nIndulhat a feldolgozs?", "Megtallt XML fjlok", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ret == JOptionPane.OK_OPTION) { String csvName = "tranzakcio_lista_" + df.format(new Date()) + "_" + System.currentTimeMillis() + ".csv"; File csv = new File(DEFAULT_EXPORT_FOLDER + "/" + csvName); app.writeCSV(csv, Arrays.asList(app.getHeaderLine())); xmlFiles.stream().forEach(xml -> { List<String> lines = app.readXMLData(xml); if (lines != null) app.writeCSV(csv, lines); }); if (csv.isFile() && csv.exists()) { JOptionPane.showMessageDialog(null, "A CSV fjl sikeresen elllt!\n" + "Fjl: " + csv.getAbsolutePath(), "Informci", JOptionPane.INFORMATION_MESSAGE); app.openFile(csv); } } else { JOptionPane.showMessageDialog(null, "Feldolgozs megszaktva!", "Informci", JOptionPane.INFORMATION_MESSAGE); } } catch (Exception ex) { JOptionPane.showMessageDialog(null, "Nem kezelt kivtel!\n" + ExceptionUtils.getStackTrace(ex), "Hiba", JOptionPane.ERROR_MESSAGE); } }
From source file:edu.gmu.isa681.client.Main.java
public static void main(String[] args) { log.info("Setting look and feel..."); try {/* w w w . j a v a 2 s . c o m*/ for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (Exception ex1) { log.warn(ex1.getMessage(), ex1); log.warn("Nimbus is not available."); log.warn("Switching to system look and feel"); log.warn("Some GUI discrepancies may occur!"); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception ex2) { log.error(ex2.getMessage(), ex2); log.error("Could not setup a look and feel."); System.exit(1); } } log.info("Initializing GUI..."); final JFrame frame = new JFrame(); frame.setTitle("GoForward"); frame.setBackground(new Color(0, 100, 0)); UIManager.put("nimbusBase", new Color(0, 100, 0)); //UIManager.put("nimbusBlueGrey", new Color(0, 100, 0)); UIManager.put("control", new Color(0, 100, 0)); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { frame.setPreferredSize(frame.getSize()); } }); Dimension dim = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); if (dim.width < 1366) { frame.setPreferredSize(new Dimension(800, 600)); } else { frame.setPreferredSize(new Dimension(1200, 700)); } //frame.setResizable(false); frame.setLocationByPlatform(true); frame.pack(); Client client = new Client("localhost", Constants.SERVER_PORT); Controller controller = new Controller(client, frame); controller.applicationStarted(); frame.setLocationRelativeTo(null); frame.setVisible(true); log.info("Started"); }
From source file:Main.java
public static void main(String[] args) { UIManager.put("ComboBox.background", new ColorUIResource(Color.yellow)); UIManager.put("JTextField.background", new ColorUIResource(Color.yellow)); UIManager.put("ComboBox.selectionBackground", new ColorUIResource(Color.magenta)); UIManager.put("ComboBox.selectionForeground", new ColorUIResource(Color.blue)); new Main();/*from w ww. j a v a 2 s . co m*/ }
From source file:Main.java
public static void main(String[] args) { UIManager.put("swing.boldMetal", Boolean.FALSE); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(new Main(), BorderLayout.CENTER); frame.pack();//from w ww .j ava 2s .c om frame.setVisible(true); }
From source file:components.TabComponentsDemo.java
public static void main(String[] args) { //Schedule a job for the event dispatch thread: //creating and showing this application's GUI. SwingUtilities.invokeLater(new Runnable() { public void run() { //Turn off metal's use of bold fonts UIManager.put("swing.boldMetal", Boolean.FALSE); new TabComponentsDemo("TabComponentsDemo").runTest(); }// w ww . j a va2 s. c om }); }
From source file:misc.TrayIconDemo.java
public static void main(String[] args) { /* Use an appropriate Look and Feel */ try {/*from w w w.j av a 2s.c o m*/ 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() { createAndShowGUI(); } }); }
From source file:Main.java
public static void main(String[] args) { UIManager.put("swing.boldMetal", Boolean.FALSE); new Main("Main").runTest(); }
From source file:events.MouseEventDemo.java
public static void main(String[] args) { /* Use an appropriate Look and Feel */ try {// w ww . j a va2 s .c o m //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(); } }); }
From source file:events.MouseMotionEventDemo.java
public static void main(String[] args) { /* Use an appropriate Look and Feel */ try {/* w w w.j ava 2 s . co m*/ //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(); } }); }
From source file:events.KeyEventDemo.java
public static void main(String[] args) { /* Use an appropriate Look and Feel */ try {//from www .j a v a 2 s .c om //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 event dispatch thread: //creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); }