Refine search
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(splitPane, BorderLayout.CENTER);
customPanel.add(createCustom("Three")); f.add(customPanel); f.pack(); f.setLocationRelativeTo(null); f.setVisible(true); EventQueue.invokeLater(new Runnable() { UIManager.getInstalledLookAndFeels(); List<String> names = new ArrayList<String>(); for (UIManager.LookAndFeelInfo info : available) { names.add(info.getName()); String current = UIManager.getLookAndFeel().getName(); combo.setSelectedItem(current); combo.addActionListener(new ActionListener() { int index = combo.getSelectedIndex(); try { UIManager.setLookAndFeel( available[index].getClassName()); SwingUtilities.updateComponentTreeUI(parent); } catch (Exception e) {
private static void launchGUI(boolean hasMain) throws Exception { try { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (Exception e) { // not available? will use default L&F } final boolean forceProbe = Boolean.getBoolean("gumshoe.probe.enabled"); final boolean needProbe = forceProbe || hasMain; final ProbeManager probe = needProbe ? ProbeManager.getInstance() : null; final JFrame frame = new JFrame("Inspector"); if( ! hasMain) { // if this is the only program, click X to exit (otherwise just hide) frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); } frame.getContentPane().add(new GUI(frame, probe, hasMain)); frame.pack(); final Dimension fullScreenSize = Toolkit.getDefaultToolkit().getScreenSize(); final int height = fullScreenSize.height; final int width = fullScreenSize.width; final Dimension unmaximizedSize = new Dimension(DEFAULT_WIDTH_PERCENT*width/100, DEFAULT_HEIGHT_PERCENT*height/100); frame.setSize(unmaximizedSize); frame.setExtendedState(JFrame.MAXIMIZED_BOTH); frame.setVisible(true); }
UIManager.getInstalledLookAndFeels(); String[] plafNames = new String[plafInfos.length]; for (int ii=0; ii<plafInfos.length; ii++) { plafNames[ii] = plafInfos[ii].getName(); plafComponents.add(plafChooser); plafComponents.add(pack); int index = plafChooser.getSelectedIndex(); try { UIManager.setLookAndFeel( plafInfos[index].getClassName() ); SwingUtilities.updateComponentTreeUI(frame); if (pack.isSelected()) { frame.pack(); frame.setMinimumSize(frame.getSize()); gui.add(plafComponents, BorderLayout.NORTH); gui.add( splitPane, BorderLayout.CENTER ); frame.setContentPane(gui); frame.pack(); frame.setLocationRelativeTo(null);
public static void main (String[] args) { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { try { UIManager.setLookAndFeel(info.getClassName()); } catch (Throwable ignored) { } break; } } EventQueue.invokeLater(new Runnable() { public void run () { new FlameMain(); } }); }
lafs = UIManager.getInstalledLookAndFeels(); counter = 0; counter %= lafs.length; try { UIManager.setLookAndFeel(lafs[counter].getClassName()); } catch(Exception e) {e.printStackTrace();} SwingUtilities.updateComponentTreeUI(frame); lafNameLabel.setText(lafs[counter++].getName()); frame.pack(); } else if (ae.getSource() == button) { if (timer.isRunning()) { frame = new JFrame("Swing Worker Example"); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setContentPane(contentPane); frame.pack(); frame.setLocationByPlatform(true); frame.setVisible(true); EventQueue.invokeLater(runnable);
public void run() { JFrame frame = new JFrame("TristateCheckBoxTest"); frame.setLayout(new GridLayout(0, 1, 15, 15)); UIManager.LookAndFeelInfo[] lfs = UIManager.getInstalledLookAndFeels(); for (UIManager.LookAndFeelInfo lf : lfs) { System.out.println("Look&Feel " + lf.getName()); try { UIManager.setLookAndFeel(lf.getClassName()); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new IllegalStateException(e); } frame.add(makePanel()); } frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); } });
UIManager.getInstalledLookAndFeels()) if ("Nimbus".equals(info.getName())) UIManager.setLookAndFeel(info.getClassName()); break; JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setUndecorated(true); f.setBackground(background); JButton b = new JButton("Text"); b.setFont(new Font("Tahoma", 0, 15)); f.getContentPane().add(b); f.setBounds(x, 400, 200, 50); f.setVisible(true);
try { for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); header.setBackground(UIManager.getColor(new JTableHeader().getBackground())); header.setBorder(UIManager.getBorder(new JTableHeader().getBorder())); frame.add(header); frame.pack(); frame.setVisible(true);
super(BoxLayout.Y_AXIS); try { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; Object o = UIManager.get("TextArea[Enabled+NotInScrollPane].borderPainter"); pane.putClientProperty("Nimbus.Overrides.InheritDefaults",false); pane.setText("Lots of Text\nWell, as much as I'm willing to type\n"); add(pane); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setContentPane(new NimbusBorderPainting()); frame.validate(); frame.pack(); frame.setVisible(true);
table.getColumnModel().getColumn(1).setCellEditor(editor); table.setPreferredScrollableViewportSize(table.getPreferredSize()); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(new JScrollPane(table)); frame.pack(); frame.setVisible(true); for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { System.out.println(info.getName()); if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break;
getScreenInsets(dialog.getGraphicsConfiguration()); int taskBarSize = scnMax.bottom; panel.setLayout(new GridBagLayout()); GridBagConstraints constraints = new GridBagConstraints(); constraints.gridx = 0; constraints.fill = GridBagConstraints.BOTH; JLabel l = new JLabel("You have got 2 new Messages."); panel.add(l, constraints); constraints.gridx++; constraints.weightx = 0f; dialog.dispose(); b.setMargin(new Insets(1, 4, 1, 4)); b.setFocusable(false); panel.add(b, constraints); dialog.setUndecorated(true); dialog.setSize(300, 100); dialog.setLocation(screenSize.width - dialog.getWidth(), screenSize.height - taskBarSize - dialog.getHeight()); lpg = new LinearGradientPaint(0, 0, 0, dialog.getHeight() / 2, for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { System.out.println(info.getName()); if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break;
initComponents(); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { new FrameTwo(FrameOne.this); FrameOne.this.dispose(); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); GroupLayout layout = new GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) ); pack(); for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new FrameOne().setVisible(true);
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); window.setLocationByPlatform(true); window.setVisible(true); setSize(iWidth, iHeight); getContentPane().setBackground(pInterfaceColour); pGradientPane = new JPanel() { private static final long serialVersionUID = 1L; pGradientPane.setPreferredSize(new Dimension(iWidth - 16, iHeight - 62)); add(pGradientPane);
add(a); for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run() { TestSuiteFrame b = new TestSuiteFrame(); b.setTitle("Login"); b.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); b.pack(); b.setVisible(true);
setLayout(new FlowLayout()); add(new JButton("test")); add(new JCheckBox("test")); add(new JRadioButton("test")); add(new JProgressBar(0, 100)); JPanel panel = new JPanel() { panel.add(new JLabel("Very long textxxxxxxxxxxxxxxxxxxxxx ")); add(panel); pack(); setLocationRelativeTo(null); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; public void run() { Window w = new TranslucentWindow(); w.setVisible(true); com.sun.awt.AWTUtilities.setWindowOpacity(w, 0.7f);
import javax.swing.UIManager.LookAndFeelInfo; import java.awt.EventQueue; import java.awt.BorderLayout; import javax.swing.*; public class Frame1 { private JFrame frame; public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } Frame1 window = new Frame1(); window.frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); }
protected static void configureLookAndFeel(String lookAndFeelName) { Exception lookAndFeelException; try { for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if (lookAndFeelName.equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); } } lookAndFeelException = null; } catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException e) { lookAndFeelException = e; } if (lookAndFeelException != null) { logger.warn("Could not switch to lookAndFeel ({}). Layout might be incorrect.", lookAndFeelName, lookAndFeelException); } }
JPanel pEnabled = new JPanel(new GridLayout(1,0,2,2)); pEnabled.setBackground(Color.green); gui.add(pEnabled, BorderLayout.NORTH); gui.add(pDisabled, BorderLayout.SOUTH); UIManager.put("Button.disabledText", new Color(40,40,255)); UIManager.getInstalledLookAndFeels(); for (UIManager.LookAndFeelInfo plafInfo : plafs) { try { UIManager.setLookAndFeel(plafInfo.getClassName()); JButton bEnabled = new JButton(plafInfo.getName()); pEnabled.add(bEnabled); JButton bDisabled = new JButton(plafInfo.getName()); bDisabled.setEnabled(false); pDisabled.add(bDisabled);
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; java.awt.EventQueue.invokeLater(new Runnable() { public void run() { OrderGUI gui = new OrderGUI(); gui.setTitle("Flexbox Order System"); gui.setResizable(false); gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); gui.setSize(new Dimension(400,400)); gui.setVisible(true);