Java 8 MetalLookAndFeel - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 MetalLookAndFeel class.

This code example shows how to use the following methods:
        Robot robot = new Robot();
        robot.setAutoDelay(20);
        SwingUtilities.invokeAndWait(new Runnable() {
            public void run() { 
                try { 
                    UIManager.setLookAndFeel(new MetalLookAndFeel());
                } catch (Exception e) {
                    e.printStackTrace();
                } 
                JTable table = new JTable(new AbstractTableModel() {
                    public int getRowCount() { 
                        return 10; 
                    } 
 
                    public int getColumnCount() { 
                        return 10; 
                    } 
 
                    public Object getValueAt(int rowIndex, int columnIndex) {
                        return "" + rowIndex + " " + columnIndex;
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
            tempDir = System.getProperty("user.home");
        } 
 
        System.out.println("Temp directory: " + tempDir);
 
        UIManager.setLookAndFeel(new MetalLookAndFeel());
 
        SwingUtilities.invokeAndWait(new Runnable() {
            public void run() { 
                HackedFileChooser openChooser = new HackedFileChooser();
 
                openChooser.setUI(new MetalFileChooserUI(openChooser));
                openChooser.setCurrentDirectory(new File(tempDir));
            } 
        }); 
    } 
 
    private static class HackedFileChooser extends JFileChooser {
        public void setUI(ComponentUI newUI) {
            super.setUI(newUI);
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        JDialog.setDefaultLookAndFeelDecorated(true);
        JFrame.setDefaultLookAndFeelDecorated(true);
        Toolkit.getDefaultToolkit().setDynamicLayout(true);
        System.setProperty("sun.awt.noerasebackground", "true");
        try { 
            UIManager.setLookAndFeel(new MetalLookAndFeel());
        } catch (UnsupportedLookAndFeelException e) {
            System.out.println(
                    "Metal Look & Feel not supported on this platform. \n" 
                    + "Program Terminated"); 
            System.exit(0);
        } 
        JFrame frame = new MetalworksFrame();
        frame.setVisible(true);
    } 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
            list.setModel(deserialized);
        } 
    } 
     
    public void testMetalLookAndFeel() { 
        LookAndFeel plaf = new MetalLookAndFeel();
        String originalXml = xstream.toXML(plaf);
        assertBothWays(plaf, originalXml);
    } 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
            tempDir = System.getProperty("user.home");
        } 
 
        System.out.println("Temp directory: " + tempDir);
 
        UIManager.setLookAndFeel(new MetalLookAndFeel());
 
        SwingUtilities.invokeAndWait(new Runnable() {
            public void run() { 
                HackedFileChooser openChooser = new HackedFileChooser();
 
                openChooser.setUI(new MetalFileChooserUI(openChooser));
                openChooser.setCurrentDirectory(new File(tempDir));
            } 
        }); 
    } 
 
    private static class HackedFileChooser extends JFileChooser {
        public void setUI(ComponentUI newUI) {
            super.setUI(newUI);
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
            throw new RuntimeException("Listeners' leak");
        } 
    } 
 
    public static void main(String[] args) throws Exception {
        UIManager.setLookAndFeel(new MetalLookAndFeel());
        SwingUtilities.invokeAndWait(new Runnable() {
            public void run() { 
                bug6559589.createGui(); 
            } 
        }); 
    } 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
  public UIDefaults getDefaults() {
    try { 
      final Method superMethod = BasicLookAndFeel.class.getDeclaredMethod("getDefaults");
      superMethod.setAccessible(true);
      final UIDefaults metalDefaults =
          (UIDefaults)superMethod.invoke(new MetalLookAndFeel());
      final UIDefaults defaults = (UIDefaults)superMethod.invoke(base);
      initInputMapDefaults(defaults);
      initIdeaDefaults(defaults);
      patchStyledEditorKit(); 
      patchComboBox(metalDefaults, defaults);
      defaults.remove("Spinner.arrowButtonBorder");
      defaults.put("Spinner.arrowButtonSize", new Dimension(16, 5));
      defaults.put("Tree.collapsedIcon", new IconUIResource(IconLoader.getIcon("/com/bulenkov/darcula/icons/treeNodeCollapsed.png")));
      defaults.put("Tree.expandedIcon", new IconUIResource(IconLoader.getIcon("/com/bulenkov/darcula/icons/treeNodeExpanded.png")));
      defaults.put("CheckBoxMenuItem.checkIcon", EmptyIcon.create(16));
      defaults.put("RadioButtonMenuItem.checkIcon", EmptyIcon.create(16));
      defaults.put("InternalFrame.icon", new IconUIResource(IconLoader.getIcon("/com/bulenkov/darcula/icons/internalFrame.png")));
      return defaults;
    } 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
See Code Examples for Java 8 MetalLookAndFeel Methods: