Java Code Examples for javax.swing.UIManager
The following code examples are extracted from open source projects. You can click to
vote up the examples that are useful to you.
Example 1
From project addis, under directory /application/src/main/java/org/drugis/addis/gui/.
Source file: Main.java

public Main(String[] args,boolean headless){ d_headless=headless; if (!d_headless) { GUIHelper.initializeLookAndFeel(); UIManager.put("Button.defaultButtonFollowsFocus",Boolean.TRUE); ToolTipManager.sharedInstance().setInitialDelay(0); GUIFactory.configureJFreeChartLookAndFeel(); } initializeDomain(); if (args.length > 0) { d_curFilename=args[0]; } }
Example 2
public static void main(String[] args){ try { for ( LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.put("nimbusBase",new Color(0xBB,0xC3,0xFF)); UIManager.put("TitledBorder.position",TitledBorder.CENTER); UIManager.put("nimbusBlueGrey",new Color(0xD1,0xD1,0xD1)); UIManager.put("control",new Color(0xFA,0xFA,0xFA)); UIManager.setLookAndFeel(info.getClassName()); break; } } } catch ( Exception e) { } JFrame f=new JFrame("Gnarley Trees"); f.addWindowListener(new java.awt.event.WindowAdapter(){ @Override public void windowClosing( java.awt.event.WindowEvent e){ System.exit(0); } } ); AlgVis A=new AlgVis(f.getRootPane()); A.setSize(WIDTH,HEIGHT); f.getContentPane().add(A); f.pack(); A.init(); f.setSize(WIDTH,HEIGHT + 20); f.setVisible(true); }
Example 3
From project ANNIS, under directory /annis-kickstarter/src/main/java/de/hu_berlin/german/korpling/annis/kickstarter/.
Source file: MainFrame.java

/** * Creates new form MainFrame */ public MainFrame(){ Integer[] sizes=new Integer[]{192,128,64,48,32,16,14}; List<Image> allImages=new LinkedList<Image>(); for ( int s : sizes) { try { BufferedImage imgIcon=ImageIO.read(MainFrame.class.getResource("logo/annis_" + s + ".png")); allImages.add(imgIcon); } catch ( IOException ex) { log.error(null,ex); } } this.setIconImages(allImages); System.setProperty("annis.home","."); this.corpusAdministration=(CorpusAdministration)AnnisBaseRunner.getBean("corpusAdministration",true,"file:" + Utils.getAnnisFile("conf/spring/Admin.xml").getAbsolutePath()); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( Exception ex) { log.error(null,ex); } initComponents(); serviceWorker=new MainFrameWorker(); serviceWorker.addPropertyChangeListener(new PropertyChangeListener(){ public void propertyChange( PropertyChangeEvent evt){ if (serviceWorker.getProgress() == 1) { pbStart.setIndeterminate(true); lblStatusService.setText("<html>Starting ANNIS...</html>"); lblStatusService.setIcon(new javax.swing.ImageIcon(getClass().getResource("/de/hu_berlin/german/korpling/annis/kickstarter/crystal_icons/quick_restart.png"))); } } } ); if (isInitialized()) { btImport.setEnabled(true); btList.setEnabled(true); serviceWorker.execute(); } }
Example 4
From project autopsy, under directory /Core/src/org/sleuthkit/autopsy/corecomponents/.
Source file: Installer.java

@Override public void restored(){ WindowManager.getDefault().invokeWhenUIReady(new Runnable(){ @Override public void run(){ Case.invokeStartupDialog(); } } ); Logger logger=Logger.getLogger(Installer.class.getName()); UIManager.put("ViewTabDisplayerUI","org.sleuthkit.autopsy.corecomponents.NoTabsTabDisplayerUI"); UIManager.put(DefaultTabbedContainerUI.KEY_VIEW_CONTENT_BORDER,BorderFactory.createEmptyBorder()); UIManager.put("TabbedPane.contentBorderInsets",new Insets(0,0,0,0)); }
Example 5
/** * @param args the command line arguments */ public static void main(String[] args){ final String[] arguments=args; java.awt.EventQueue.invokeLater(new Runnable(){ public void run(){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( Exception e) { try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch ( Exception e2) { } } String pathName=null; if (arguments.length > 0) { pathName=arguments[0]; } JFrame frame=new JBMachAppFrame(pathName); frame.setLocationRelativeTo(null); frame.setVisible(true); } } ); }
Example 6
private void setUILook(){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( UnsupportedLookAndFeelException ex) { System.out.println("Unable to load native look and feel"); } catch ( ClassNotFoundException e) { } catch ( InstantiationException e) { } catch ( IllegalAccessException e) { } }
Example 7
public Calindrom(String title) throws Exception { super(title); Data.Init(); m_calendar=new CalendarPanel(this); getContentPane().add(m_calendar); setMinimumSize(new Dimension(Calindrom.MIN_WIDTH,Calindrom.MIN_HEIGHT)); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( Exception e) { System.out.println("Error setting native LAF: " + e); } }
Example 8
From project CBCJVM, under directory /cbc/CBCJVM/src/cbccore/low/.
Source file: CBCSimulator.java

public CBCSimulator(){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( Exception e) { System.out.println("Error setting native LAF: " + e); } cbob=new SimulatedCBOB(this); sound=new SimulatedSound(this); sensor=new SimulatedSensor(this); device=new SimulatedDevice(this); display=new SimulatedDisplay(this); input=new SimulatedInput(this); servo=new SimulatedServo(this); motor=new SimulatedMotor(this); camera=new SimulatedCamera(this); create=new SimulatedCreate(this); for (int i=0; i < motorSpeedLabels.length; ++i) { motorSpeedLabels[i]=new JLabel(); } if (stdOut == null) { stdOut=System.out; } System.out.println("Welcome to CBCJava"); frame.getContentPane().add(new JScrollPane(display.getTextBox()),BorderLayout.CENTER); System.setOut(display.getPrintStream()); addSidebar(); addMotorLabels(); addButtons(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize(); frame.setSize(Math.min(1024,(int)(screenSize.width * .7)),Math.min(768,(int)(screenSize.height * .7))); frame.setVisible(true); new MotorSpeedUpdater(this,100).start(); }
Example 9
From project ceres, under directory /ceres-ui/src/main/java/com/bc/ceres/swing/demo/.
Source file: FocusApp.java

public static void main(String[] args){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( Exception e) { } JPanel panel=new MyJPanel(); panel.setPreferredSize(new Dimension(512,512)); AdjustableViewScrollPane viewScrollPane=new AdjustableViewScrollPane(panel); JFrame jFrame=new JFrame("x"); jFrame.add(viewScrollPane); JTree tree1=new JTree(new Object[]{"Aaaaaaaaaaaaa","B","C"}); JTree tree2=new JTree(new Object[]{"Xxxxxxxxxxxxx","Y","Z"}); tree1.setCellRenderer(new MyDefaultTreeCellRenderer()); tree2.setCellRenderer(new MyDefaultTreeCellRenderer()); tree1.addFocusListener(new MyFocusListener()); tree2.addFocusListener(new MyFocusListener()); showFrame(tree1); showFrame(tree2); JList list1=new JList(new Object[]{"Aaaaaaaaaaaaa","B","C"}); JList list2=new JList(new Object[]{"Xxxxxxxxxxxxx","Y","Z"}); list1.setCellRenderer(new MyDefaultListCellRenderer()); list2.setCellRenderer(new MyDefaultListCellRenderer()); list1.addFocusListener(new MyFocusListener()); list2.addFocusListener(new MyFocusListener()); showFrame(list1); showFrame(list2); }
Example 10
From project ChkBugReport, under directory /src/com/sonyericsson/chkbugreport/.
Source file: Main.java

private void showGui(){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( Exception e) { e.printStackTrace(); } mGui=new Gui(this); mGui.setVisible(true); }
Example 11
From project Cinch, under directory /example/com/palantir/ptoss/cinch/example/simple/.
Source file: BoundLocationExample.java

public static void main(String[] args) throws InterruptedException, InvocationTargetException { Examples.initializeLogging(); try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); EventQueue.invokeAndWait(new Runnable(){ public void run(){ new BoundLocationExample(); } } ); } catch ( Exception e) { e.printStackTrace(); } }
Example 12
From project CloudReports, under directory /src/main/java/cloudreports/gui/.
Source file: MainView.java

/** * The entry point of the application. * @param args the command line arguments. */ public static void main(String args[]) throws IOException { try { boolean wasFound=false; for ( UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.put("nimbusBase",new Color(152,153,155)); UIManager.put("nimbusBlueGrey",new Color(178,178,178)); UIManager.put("control",new Color(232,232,232)); UIManager.setLookAndFeel(info.getClassName()); wasFound=true; break; } } if (!wasFound) { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); Dialog.showWarning(new JFrame(),"The default Java \"Look and Feel\" of this application is not available\n" + "on your system. This can be solved by updating your current Java enviroment.\n" + "Due to this problem, some UI elements might appear different than intended."); } } catch ( Exception ex) { Logger.getLogger(Database.class.getName()).log(Level.INFO,null,ex); } java.awt.EventQueue.invokeLater(new Runnable(){ @Override public void run(){ try { new MainView().setVisible(true); } catch ( IOException ex) { Logger.getLogger(MainView.class.getName()).log(Level.SEVERE,null,ex); } } } ); }
Example 13
/** * This is the main entry-point. It sets the native Look&Feel, creates and shows the MainView. * @param args the command line arguments. The first parameterwill be passed to {@link code_swarm}. It specifies the config-file. */ public static void main(final String args[]){ java.awt.EventQueue.invokeLater(new Runnable(){ public void run(){ Toolkit.getDefaultToolkit().setDynamicLayout(true); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( ClassNotFoundException e) { } catch ( InstantiationException e) { } catch ( IllegalAccessException e) { } catch ( UnsupportedLookAndFeelException e) { } try { File f=new File("data/log.properties"); InputStream in=new FileInputStream(f); LogManager.getLogManager().readConfiguration(in); in.close(); } catch ( IOException ex) { Logger.getLogger(MainView.class.getName()).log(Level.SEVERE,null,ex); } catch ( SecurityException ex) { Logger.getLogger(MainView.class.getName()).log(Level.SEVERE,null,ex); } new MainView(args).setVisible(true); } } ); }
Example 14
/** * This is the main entry-point. It sets the native Look&Feel, creates and shows the MainView. * @param args the command line arguments. The first parameterwill be passed to {@link code_swarm}. It specifies the config-file. */ public static void main(final String args[]){ java.awt.EventQueue.invokeLater(new Runnable(){ public void run(){ Toolkit.getDefaultToolkit().setDynamicLayout(true); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( ClassNotFoundException e) { } catch ( InstantiationException e) { } catch ( IllegalAccessException e) { } catch ( UnsupportedLookAndFeelException e) { } try { File f=new File("data/log.properties"); InputStream in=new FileInputStream(f); LogManager.getLogManager().readConfiguration(in); in.close(); } catch ( IOException ex) { Logger.getLogger(MainView.class.getName()).log(Level.SEVERE,null,ex); } catch ( SecurityException ex) { Logger.getLogger(MainView.class.getName()).log(Level.SEVERE,null,ex); } new MainView(args).setVisible(true); } } ); }
Example 15
From project codjo-broadcast, under directory /codjo-broadcast-gui/src/main/java/net/codjo/broadcast/gui/.
Source file: BroadcastFileContentsDetailWindow.java

private void initGui() throws Exception { this.setResizable(true); this.getContentPane().setBackground(UIManager.getColor("Panel.background")); this.setPreferredSize(new Dimension(430,430)); this.getContentPane().setLayout(borderLayout1); mainPanel.setLayout(gridBagLayout3); columnPanel.setBorder(new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(142,142,142)),"")); columnPanel.setLayout(gridBagLayout2); columnSeparator.setMaxTextLength(2); sectionPanel.setLayout(gridBagLayout1); sectionPosition.setColumns(0); headerPanel.setBorder(new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(134,134,134)),"")); headerPanel.setLayout(new BorderLayout()); headerPanel.add(headerScrollPane,BorderLayout.CENTER); dataSource.addDataSourceListener(new net.codjo.mad.gui.request.event.DataSourceAdapter(){ @Override public void saveEvent( DataSourceEvent event){ dataSourceSaveEvent(); } } ); sectionTabPanel.setName("tabPanel"); this.getContentPane().add(sectionTabPanel,BorderLayout.CENTER); this.getContentPane().add(buttonPanelLogic.getGui(),BorderLayout.SOUTH); sectionTabPanel.add(mainPanel,"Section"); columnPanel.add(separatorLabel,new GridBagConstraints(0,0,1,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(0,5,5,0),0,0)); columnPanel.add(columnSeparator,new GridBagConstraints(1,0,1,1,1.0,0.0,GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL,new Insets(0,5,5,0),51,0)); columnPanel.add(columnHeader,new GridBagConstraints(2,0,1,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(0,18,5,165),0,0)); sectionPanel.add(sectionNameLabel,new GridBagConstraints(0,0,1,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(10,5,0,12),8,0)); sectionPanel.add(sectionId,new GridBagConstraints(1,0,2,1,1.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(10,5,0,10),181,0)); sectionPanel.add(positionLabel,new GridBagConstraints(0,1,1,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(10,5,0,0),0,0)); sectionPanel.add(sectionPosition,new GridBagConstraints(1,1,1,1,1.0,0.0,GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL,new Insets(10,5,0,0),30,0)); sectionPanel.add(sectionHeader,new GridBagConstraints(2,1,1,1,0.0,0.0,GridBagConstraints.EAST,GridBagConstraints.NONE,new Insets(10,92,0,10),0,0)); sectionPanel.add(headerPanel,new GridBagConstraints(0,2,3,1,1.0,1.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(10,5,5,5),0,0)); mainPanel.add(columnPanel,new GridBagConstraints(0,1,1,1,1.0,1.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,9),-5,0)); headerScrollPane.getViewport().add(sectionHeaderText,null); mainPanel.add(sectionPanel,new GridBagConstraints(0,0,1,1,1.0,1.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,9),4,54)); }
Example 16
From project codjo-control, under directory /codjo-control-gui/src/main/java/net/codjo/control/gui/plugin/.
Source file: DefaultQuarantineDetailWindow.java

private void addFormPanels(){ this.setBackground(UIManager.getColor("Panel.background")); this.getContentPane().add(mainTabbedPane,BorderLayout.CENTER); for ( LabelledItemPanel panel : mainPanelList) { mainTabbedPane.addTab(panel.getName(),panel); } this.getContentPane().add(buttonPanelLogic.getGui(),BorderLayout.SOUTH); }
Example 17
From project codjo-data-process, under directory /codjo-data-process-gui/src/main/java/net/codjo/dataprocess/gui/launcher/configuration/.
Source file: ConfigurationDialog.java

private void initBottomPanel(){ quitButton.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent evt){ quitCommand(); } } ); quitButton.setIcon(UIManager.getIcon("dataprocess.exit")); GuiUtils.setMaxSize(quitButton,36,25); bottomPanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); bottomPanel.add(quitButton); }
Example 18
From project codjo-segmentation, under directory /codjo-segmentation-gui/src/main/java/net/codjo/segmentation/gui/wizard/.
Source file: LogWindowAction.java

private void displayNewWindow(){ try { LogWindowLogic logic=new LogWindowLogic(getGuiContext(),anomalieResult,preferenceId); if (customizer != null) { customizer.customizeWindow(logic); } SimpleListGui gui=logic.getGui(); gui.setFrameIcon(UIManager.getIcon("icon")); getDesktopPane().add(gui); gui.pack(); gui.setVisible(true); gui.setSelected(true); } catch ( Exception ex) { String message="Erreur lors de l'affichage des r?ultats de la segmentation."; APP.error(message,ex); ErrorDialog.show(getDesktopPane(),message,ex); } }
Example 19
From project codjo-standalone-common, under directory /src/main/java/net/codjo/gui/broadcast/.
Source file: BroadcastFileContentsDetailWindow.java

private void jbInitGui() throws Exception { this.setResizable(true); this.setTitle("D?ail de la table"); this.getContentPane().setBackground(UIManager.getColor("Panel.background")); this.setPreferredSize(new Dimension(430,430)); this.getContentPane().setLayout(gridBagLayout3); jPanel1.setLayout(borderLayout1); columnPanel.setBorder(new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(142,142,142)),"Colonnes")); columnPanel.setLayout(gridBagLayout2); separatorLabel.setText("S?arateur"); sectionPanel.setLayout(gridBagLayout1); SECTION_POSITION.setColumns(0); COLUMN_HEADER.setText("En t?e"); positionLabel.setText("Position"); SECTION_HEADER.setText("Ins?er l\'en t?e de la section"); sectionNameLabel.setText("Nom"); headerScrollPane.setBorder(new TitledBorder(BorderFactory.createEtchedBorder(Color.white,new Color(134,134,134)),"En-t?e")); this.getContentPane().add(sectionTabPanel,new GridBagConstraints(0,0,1,1,1.0,1.0,GridBagConstraints.NORTH,GridBagConstraints.BOTH,new Insets(10,5,0,5),0,0)); this.getContentPane().add(detailButtonsPanel,new GridBagConstraints(0,1,1,1,0.0,0.0,GridBagConstraints.SOUTH,GridBagConstraints.HORIZONTAL,new Insets(10,5,5,5),0,0)); sectionTabPanel.add(jPanel1,"Section"); columnPanel.add(separatorLabel,new GridBagConstraints(0,0,1,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(0,5,5,0),0,0)); columnPanel.add(COLUMN_SEPARATOR,new GridBagConstraints(1,0,1,1,1.0,0.0,GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL,new Insets(0,5,5,0),51,0)); columnPanel.add(COLUMN_HEADER,new GridBagConstraints(2,0,1,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(0,18,5,165),0,0)); sectionPanel.add(sectionNameLabel,new GridBagConstraints(0,0,1,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(10,5,0,12),8,0)); sectionPanel.add(SECTION_ID,new GridBagConstraints(1,0,2,1,1.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(10,5,0,10),181,0)); sectionPanel.add(positionLabel,new GridBagConstraints(0,1,1,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(10,5,0,0),0,0)); sectionPanel.add(SECTION_POSITION,new GridBagConstraints(1,1,1,1,1.0,0.0,GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL,new Insets(10,5,0,0),30,0)); sectionPanel.add(SECTION_HEADER,new GridBagConstraints(2,1,1,1,0.0,0.0,GridBagConstraints.EAST,GridBagConstraints.NONE,new Insets(10,92,0,10),0,0)); sectionPanel.add(headerScrollPane,new GridBagConstraints(0,2,3,1,1.0,1.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(10,5,5,5),0,0)); headerScrollPane.getViewport().add(SECTION_HEADER_TEXT,null); jPanel1.add(columnPanel,BorderLayout.SOUTH); jPanel1.add(sectionPanel,BorderLayout.CENTER); }
Example 20
From project dawn-common, under directory /org.dawb.hdf5/src/ncsa/hdf/view/.
Source file: DefaultTableView.java

public RowHeaderRenderer(){ super(); setHorizontalAlignment(JLabel.CENTER); setOpaque(true); setBorder(UIManager.getBorder("TableHeader.cellBorder")); setBackground(Color.lightGray); }
Example 21
From project drugis-common, under directory /common-gui/src/main/java/org/drugis/common/gui/.
Source file: GUIHelper.java

public static void initializeLookAndFeel(){ try { String osName=System.getProperty("os.name"); if (osName.startsWith("Windows")) { UIManager.setLookAndFeel(new WindowsLookAndFeel()); } else if (osName.startsWith("Mac")) { } else { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); } catch ( Exception e) { UIManager.setLookAndFeel(new PlasticLookAndFeel()); } } } catch ( Exception e) { } }
Example 22
From project e4-rendering, under directory /com.toedter.e4.demo.contacts.swing/src/com/toedter/e4/demo/contacts/swing/handlers/.
Source file: SwitchThemeHandler.java

@Execute public void switchTheme(@Named("contacts.commands.switchtheme.themeid") final String themeId,final JFrame frame){ SwingUtilities.invokeLater(new Runnable(){ @Override public void run(){ try { UIManager.setLookAndFeel(themeId); SwingUtilities.updateComponentTreeUI(frame); } catch ( ClassNotFoundException e) { e.printStackTrace(); } catch ( InstantiationException e) { e.printStackTrace(); } catch ( IllegalAccessException e) { e.printStackTrace(); } catch ( UnsupportedLookAndFeelException e) { e.printStackTrace(); } } } ); }
Example 23
From project extension_libero_manufacturing, under directory /extension/eevolution/libero/src/main/java/it/cnr/imaa/essi/lablib/gui/checkboxtree/.
Source file: DefaultCheckboxTreeCellRenderer.java

public DefaultCheckboxTreeCellRenderer(){ this.setLayout(new FlowLayout(FlowLayout.LEFT,0,0)); add(this.checkBox); add(this.label); this.checkBox.setBackground(UIManager.getColor("Tree.textBackground")); this.setBackground(UIManager.getColor("Tree.textBackground")); }
Example 24
From project FBReaderJ, under directory /obsolete/swing/src/org/geometerplus/zlibrary/ui/swing/library/.
Source file: ZLSwingLibrary.java

@SuppressWarnings("unchecked") public void run(String[] args){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( Exception e) { e.printStackTrace(); } new ZLOwnXMLProcessorFactory(); new ZLOwnHtmlProcessorFactory(); loadProperties(); new ZLXMLConfigManager(System.getProperty("user.home") + "/." + getInstance().getApplicationName()); new ZLSwingImageManager(); new ZLSwingDialogManager(); ZLApplication application=null; try { application=(ZLApplication)getApplicationClass().getConstructor(String[].class).newInstance(new Object[]{args}); } catch ( Exception e) { e.printStackTrace(); shutdown(); } ZLSwingApplicationWindow mainWindow=((ZLSwingDialogManager)ZLSwingDialogManager.getInstance()).createApplicationWindow(application); application.initWindow(); mainWindow.run(); }
Example 25
/** * Sets the look and feel. */ private static void setLookAndFeel(){ try { String laf=getString("wizard.laf","com.jgoodies.looks.plastic.Plastic3DLookAndFeel"); if (laf != null) { if (laf.startsWith("com.jgoodies.looks.plastic")) { String theme=getString("wizard.theme"); if (theme != null) { PlasticLookAndFeel.setPlasticTheme((PlasticTheme)Class.forName(theme).newInstance()); } } UIManager.setLookAndFeel(laf); } } catch ( Exception e) { throw new BuildException(e); } }
Example 26
From project freemind, under directory /freemind/accessories/plugins/time/.
Source file: JDayChooser.java

public void setDayBordersVisible(boolean dayBordersVisible){ this.dayBordersVisible=dayBordersVisible; if (initialized) { for (int x=7; x < 49; x++) { if ("Windows".equals(UIManager.getLookAndFeel().getID())) { days[x].setContentAreaFilled(dayBordersVisible); } else { days[x].setContentAreaFilled(true); } days[x].setBorderPainted(dayBordersVisible); } } }
Example 27
private void lookAndFeelUpdate(String className){ if (className != null) { try { UIManager.setLookAndFeel(className); AppWindow.lookAndFeelUpdate(); } catch ( Exception e1) { GUIUtil.displayError(null,e1,null); } } }
Example 28
public static void main(String[] args){ EventQueue.invokeLater(new Runnable(){ public void run(){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( Exception e) { } GitblitManager frame=new GitblitManager(); frame.initialize(); frame.setVisible(true); } } ); }
Example 29
From project glg2d, under directory /src/test/java/glg2d/examples/shaders/.
Source file: DepthSimExample.java

public static void main(String[] args) throws Exception { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); final JFrame frame=new JFrame("Depth Shaker Example"); frame.setContentPane(new G2DGLPanel(new UIDemo()){ @Override protected G2DGLEventListener createG2DListener( JComponent drawingComponent){ return new G2DGLEventListener(drawingComponent){ @Override protected GLGraphics2D createGraphics2D( GLAutoDrawable drawable){ return new GLGraphics2D(){ @Override protected void createDrawingHelpers(){ super.createDrawingHelpers(); addG2DDrawingHelper(new DepthShaker()); } @Override protected void scissor( boolean enable){ } } ; } } ; } } ); Timer timer=new Timer(100,new ActionListener(){ @Override public void actionPerformed( ActionEvent e){ frame.getContentPane().repaint(); } } ); timer.setRepeats(true); timer.start(); frame.setPreferredSize(new Dimension(1024,768)); frame.pack(); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); }
Example 30
From project Gmote, under directory /gmoteserver/src/org/gmote/server/.
Source file: GmoteServerUiMac.java

void initializeUi(){ JMenuItem item; try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( Exception e) { e.printStackTrace(); } if (Integer.parseInt(System.getProperty("java.version").substring(2,3)) >= 5) System.setProperty("javax.swing.adjustPopupLocationToFit","false"); popupMenu=new JPopupMenu("Gmote Menu"); addMediaPlayerControls(); JMenu settingsMenu=new JMenu("Settings"); popupMenu.add(settingsMenu); item=new JMenuItem("Change password"); item.addActionListener(settingsListener); settingsMenu.add(item); item=new JMenuItem("Change media paths"); item.addActionListener(mediaPathListener); settingsMenu.add(item); JMenu helpMenu=new JMenu("Help"); popupMenu.add(helpMenu); item=new JMenuItem("Show local ip address"); item.addActionListener(ipAddressListener); helpMenu.add(item); item=new JMenuItem("Show settings and logs folder"); item.addActionListener(logFolderListener); helpMenu.add(item); item=new JMenuItem("Connection Help"); item.addActionListener(helpListener); helpMenu.add(item); popupMenu.addSeparator(); item=new JMenuItem("Quit"); item.addActionListener(exitListener); popupMenu.add(item); ImageIcon i=new ImageIcon(GmoteServerUiMac.class.getResource("/res/gmote_icon_s.png")); trayIcon=new TrayIcon(i,"Gmote",popupMenu); trayIcon.setIconAutoSize(true); tray.addTrayIcon(trayIcon); }
Example 31
private void setSkin(String lookAndFeel) throws FileNotFoundException, IOException { try { UIManager.setLookAndFeel(lookAndFeel); } catch ( ClassNotFoundException e) { e.printStackTrace(); } catch ( InstantiationException e) { e.printStackTrace(); } catch ( IllegalAccessException e) { e.printStackTrace(); } catch ( UnsupportedLookAndFeelException e) { e.printStackTrace(); } SwingUtilities.updateComponentTreeUI(frmGroovejaar); frmGroovejaar.pack(); }
Example 32
From project gs-core, under directory /src-test/org/graphstream/ui/viewer/test/.
Source file: DemoViewerJComponents.java

protected static void setLAF(){ try { UIManager.LookAndFeelInfo[] installed=UIManager.getInstalledLookAndFeels(); for (int i=0; i < installed.length; i++) { if (installed[i].getName().startsWith("GTK")) { UIManager.setLookAndFeel(installed[i].getClassName()); i=installed.length; } } } catch ( Exception e) { e.printStackTrace(); } }
Example 33
protected void setLAF(){ try { UIManager.LookAndFeelInfo[] installed=UIManager.getInstalledLookAndFeels(); for (int i=0; i < installed.length; i++) { if (installed[i].getName().startsWith("GTK")) { UIManager.setLookAndFeel(installed[i].getClassName()); i=installed.length; } } } catch ( Exception e) { e.printStackTrace(); } }
Example 34
From project Hotel-Management_MINF10-HCM, under directory /HotelManagement/src/main/java/core/datechooser/.
Source file: JDayChooser.java

public void setDayBordersVisible(boolean dayBordersVisible){ this.dayBordersVisible=dayBordersVisible; if (initialized) { for (int x=7; x < 49; x++) { if ("Windows".equals(UIManager.getLookAndFeel().getID())) { days[x].setContentAreaFilled(dayBordersVisible); } else { days[x].setContentAreaFilled(true); } days[x].setBorderPainted(dayBordersVisible); } } }
Example 35
From project hudsontrayapp-plugin, under directory /client-common/src/main/java/org/hudson/trayapp/.
Source file: HudsonTrayApp.java

public static void main(String[] args){ HudsonTrayApp.args=args; try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( Exception e) { } getHudsonTrayAppInstance(); }
Example 36
From project imageflow, under directory /src/de/danielsenff/imageflow/.
Source file: ImageFlow.java

@Override protected void initialize(String[] args){ super.initialize(args); if (hasImageJInstance()) { this.actsAsImagejPlugin=true; } this.addExitListener(new ImageJExitListener()); Task initializeDelegatesTask=new InitializeDelegatesTask(this); TaskService ts=ImageFlow.getApplication().getContext().getTaskService(); ts.execute(initializeDelegatesTask); if (System.getProperty("mrj.version") == null) { } else { MacApplication macApplication=new MacApplication(getApplication()); } UIManager.put("swing.boldMetal",Boolean.FALSE); }
Example 37
public void init(){ try { SwingUtilities.invokeAndWait(new Runnable(){ public void run(){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( Exception e) { } final JFlowPanel panel=new JFlowPanel(new Configuration()); panel.addListener(Applet.this); getContentPane().add(panel); } } ); } catch ( Exception e) { } }
Example 38
/** * Returns the height of the row. This method calculates the row height based on the current font sent on the table where as, <code>javax.swing.JTable</code> always returns a fixed row height, which does not work well, especially, when using a Theme or look and feel other than the defaults. * @return Row height */ @Override public int getRowHeight(){ Font font=getFont(); if (font == null) { font=(Font)UIManager.get("Table.font"); } FontMetrics metrics=getFontMetrics(font); return metrics.getLeading() + metrics.getMaxAscent() + metrics.getMaxDescent()+ 2; }
Example 39
From project jgraphx, under directory /examples/com/mxgraph/examples/swing/editor/.
Source file: BasicGraphEditor.java

/** */ public void setLookAndFeel(String clazz){ JFrame frame=(JFrame)SwingUtilities.windowForComponent(this); if (frame != null) { try { UIManager.setLookAndFeel(clazz); SwingUtilities.updateComponentTreeUI(frame); keyboardHandler=new EditorKeyboardHandler(graphComponent); } catch ( Exception e1) { e1.printStackTrace(); } } }
Example 40
From project jmd, under directory /src/org/apache/bcel/verifier/.
Source file: GraphicalVerifier.java

/** * Main method. */ public static void main(String[] args){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( Exception e) { e.printStackTrace(); } new GraphicalVerifier(); }
Example 41
From project jMemorize, under directory /src/jmemorize/gui/swing/frames/.
Source file: FindFrame.java

private JPanel buildSearchPanel(){ setupSearchTextBox(); JScrollPane scrollPane=new JScrollPane(m_cardTable); Color color=UIManager.getColor("Table.background"); scrollPane.getViewport().setBackground(color); scrollPane.setPreferredSize(new Dimension(500,200)); FormLayout layout=new FormLayout("right:pref, 3dlu, pref:grow, 3dlu, pref:grow, 3dlu, pref:grow","p, 3dlu, p, 3dlu, p, 3dlu, p, 9dlu, p, 9dlu, fill:d:grow"); CellConstraints cc=new CellConstraints(); DefaultFormBuilder builder=new DefaultFormBuilder(layout); builder.setDefaultDialogBorder(); builder.addLabel(Localization.get("FindTool.SEARCH_TEXT"),cc.xy(1,1)); builder.add(m_searchTextBox,cc.xyw(3,1,5)); builder.addLabel(Localization.get("General.CATEGORY"),cc.xy(1,3)); builder.add(m_categoryBox,cc.xyw(3,3,5)); builder.addLabel(Localization.get("FindTool.SETTINGS"),cc.xy(1,5)); builder.add(m_radioBothSides,cc.xy(3,5)); builder.add(m_radioFrontSide,cc.xy(5,5)); builder.add(m_radioBackSide,cc.xy(7,5)); builder.add(m_matchCaseBox,cc.xyw(3,7,5)); builder.addSeparator(Localization.get("FindTool.RESULTS"),cc.xyw(1,9,7)); builder.add(scrollPane,cc.xyw(1,11,7)); return builder.getPanel(); }
Example 42
From project jninka, under directory /jninka-parent/jninka-gui/src/main/java/org/whitesource/jninka/gui/.
Source file: Agent.java

/** * Main entry point. * @param args */ public static void main(String[] args){ initLogging(); logger=Logger.getLogger(Agent.class.getName()); logger.info("******************** Starting JNinka ********************"); initProperties(); final AgentPresenter presenter=new AgentPresenter(); try { for ( LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } } catch ( Exception e) { logger.log(Level.SEVERE,"General error",e); } javax.swing.SwingUtilities.invokeLater(new Runnable(){ public void run(){ presenter.setVersion(version); presenter.show(); presenter.checkForUpdates(); } } ); }
Example 43
/** * @return The default blink/flash rate. */ public static int getDefaultBlinkRate(){ Object oblink=UIManager.get("TextArea.caretBlinkRate",null); int blink=500; if (oblink != null && oblink instanceof Number) blink=((Number)oblink).intValue(); return blink; }
Example 44
public static void main(String[] args){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( Exception e) { } String launchFilename="", launchPrefsFilename=null; int ARGMODE_FILE=0; int ARGMODE_PREF=1; int argMode=ARGMODE_FILE; for (int i=0; i < args.length; i++) { if (args[i].startsWith("-h") || args[i].startsWith("--h")) { System.out.println("Jreepad command-line arguments:"); System.out.println(" -p [prefsfile] Load/save preferences from named location instead of default"); System.out.println(" [filename] Jreepad/treepad file to load on startup"); System.out.println(" "); System.out.println("For example:"); System.out.println(" java -jar Jreepad.jar -p /Users/jo/Library/jreeprefs.dat /Users/jo/Documents/mynotes.hjt"); System.exit(1); } else if (args[i].equals("-p")) argMode=ARGMODE_PREF; else if (argMode == ARGMODE_PREF && launchPrefsFilename == null) { launchPrefsFilename=args[i]; argMode=ARGMODE_FILE; } else if (argMode == ARGMODE_FILE && launchFilename.equals("")) { launchFilename=args[i]; } } new JreepadViewer(launchFilename,launchPrefsFilename); }
Example 45
From project jreversepro, under directory /src/main/java/org/jreversepro/gui/.
Source file: MenuLooknFeel.java

private void updateLF(final JFrame thisFrame){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); SwingUtilities.updateComponentTreeUI(thisFrame); } catch ( Exception _ex) { } }
Example 46
From project jumpnevolve, under directory /src/com/jdotsoft/jarloader/.
Source file: JarClassLoader.java

/** * Call this method after UIManager.setLookAndFeel(..) to preload non standard UI classes. <br> At runtime some JComponent class tries to load LaF UI class. The JVM uses the JComponent's class loader, which is system class loader to load UI class and fails because LaF classes reside in an external JAR. A workaround is to preload LaF classes explicitly. <br> See details https://lists.xcf.berkeley.edu/lists/advanced-java/2001-January /015374.html * @throws ClassNotFoundException If the class could not be found. */ public static void loadLookAndFeel() throws ClassNotFoundException { LookAndFeel laf=UIManager.getLookAndFeel(); if (laf == null) { return; } ClassLoader cl=laf.getClass().getClassLoader(); if (cl == null) { return; } if (cl.getClass().getName().equals(JarClassLoader.class.getName())) { UIDefaults uidef=UIManager.getDefaults(); Enumeration<?> en=uidef.keys(); while (en.hasMoreElements()) { String sClass=(String)en.nextElement(); if (sClass.endsWith("UI")) { Object obj=uidef.get(sClass); if (obj instanceof String) { Class<?> clazz=cl.loadClass((String)obj); uidef.put(clazz.getName(),clazz); } } } } }
Example 47
From project jupload, under directory /src/wjhk/jupload2/gui/.
Source file: SortHeaderRenderer.java

/** * @see javax.swing.table.DefaultTableCellRenderer#getTableCellRendererComponent(javax.swing.JTable,java.lang.Object,boolean,boolean,int,int) */ @Override public Component getTableCellRendererComponent(JTable table,Object value,@SuppressWarnings("unused") boolean isSelected,@SuppressWarnings("unused") boolean hasFocus,@SuppressWarnings("unused") int row,int col){ int index=-1; boolean ascending=true; if (table instanceof FilePanelJTable) { FilePanelJTable sortTable=(FilePanelJTable)table; index=sortTable.getSortedColumnIndex(); ascending=sortTable.isSortedColumnAscending(); } if (table != null) { JTableHeader header=table.getTableHeader(); if (header != null) { setForeground(header.getForeground()); setBackground(header.getBackground()); setFont(header.getFont()); } } Icon icon=ascending ? ASCENDING : DESCENDING; setIcon(col == index ? icon : NONSORTED); setText((value == null) ? "" : value.toString()); setBorder(UIManager.getBorder("TableHeader.cellBorder")); return this; }
Example 48
public static ControlWindow create(final Laserschein theSchein){ try { if (Platform.isWindows()) { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } else { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } } catch ( Exception e) { Logger.printWarning("Could not seet GUI look and feel. No worries..."); } final ControlWindow myApplet=new ControlWindow(theSchein,550,550); myApplet.init(); return myApplet; }
Example 49
From project liquidfeedback-java-sdk, under directory /examples/src/main/java/lfapi/v2/services/example/.
Source file: ApiSampleAreaUnit.java

/** * Creates the and show GUI. */ static void createAndShowGUI(){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( Exception e) { System.err.println("Couldn't use system look and feel."); } JFrame frame=new JFrame("ApiSampleAreaUnit"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(new ApiSampleAreaUnit()); frame.setBounds(300,200,800,600); frame.pack(); frame.setVisible(true); }
Example 50
From project Maimonides, under directory /src/com/codeko/apps/maimonides/alumnos/.
Source file: PanelAccesoFichaAlumnos.java

private void configurarTabla(){ AbstractHighlighter h=new AbstractHighlighter(){ @Override protected Component doHighlight( Component c, ComponentAdapter adapt){ Object valor=adapt.getValue(); if (valor instanceof Alumno) { Alumno a=(Alumno)adapt.getValue(); if (adapt.isSelected()) { Color back=UIManager.getDefaults().getColor("Table.selectionBackground"); c.setBackground(back); Color fore=UIManager.getDefaults().getColor("Table.selectionForeground"); c.setForeground(fore); } else { Color back=UIManager.getDefaults().getColor("Table.background"); c.setBackground(back); Color fore=UIManager.getDefaults().getColor("Table.foreground"); c.setForeground(fore); } } else if (valor instanceof Integer && Num.getInt(valor) < 10) { if (!adapt.isSelected()) { c.setBackground(ParteFaltas.getColorTipoFalta(valor)); c.setForeground(UIManager.getDefaults().getColor("Table.foreground")); } } else if (valor == null) { c.setBackground(Color.LIGHT_GRAY); } if (adapt.hasFocus()) { ((JComponent)c).setBorder(BorderFactory.createLineBorder(Color.red,2)); c.setForeground(Color.red); c.setFont(c.getFont().deriveFont(Font.BOLD)); } return c; } } ; }
Example 51
From project maple-ide, under directory /build/windows/launcher/launch4j/demo/SimpleApp/src/net/sf/launch4j/example/.
Source file: SimpleApp.java

public static void setLAF(){ JFrame.setDefaultLookAndFeelDecorated(true); Toolkit.getDefaultToolkit().setDynamicLayout(true); System.setProperty("sun.awt.noerasebackground","true"); try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch ( Exception e) { System.err.println("Failed to set LookAndFeel"); } }
Example 52
From project medsavant, under directory /medsavant/MedSavantClient/src/org/ut/biolab/medsavant/.
Source file: MedSavantClient.java

private static void setLAF(){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); if (MiscUtils.WINDOWS) { LookAndFeelFactory.installJideExtension(LookAndFeelFactory.XERTO_STYLE_WITHOUT_MENU); } UIManager.put("TabbedPane.contentBorderInsets",new Insets(0,0,0,0)); UIManager.put("ToolTip.background",new ColorUIResource(255,255,255)); ToolTipManager.sharedInstance().setDismissDelay(8000); ToolTipManager.sharedInstance().setInitialDelay(500); } catch ( Exception x) { LOG.error("Unable to install look & feel.",x); } }
Example 53
From project movsim, under directory /viewer/src/main/java/org/movsim/viewer/ui/.
Source file: AppFrame.java

private void initLookAndFeel(){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); System.out.println("set to system LaF"); } catch ( final ClassNotFoundException e) { e.printStackTrace(); } catch ( final InstantiationException e) { e.printStackTrace(); } catch ( final IllegalAccessException e) { e.printStackTrace(); } catch ( final UnsupportedLookAndFeelException e) { e.printStackTrace(); } SwingUtilities.updateComponentTreeUI(this); }
Example 54
From project mtc, under directory /mtc-gui/src/main/java/org/drugis/mtc/gui/.
Source file: AuxComponentFactory.java

public static JPanel createWarningPanel(String warningText){ Icon icon=UIManager.getIcon("OptionPane.warningIcon"); if (icon == null) { icon=MainWindow.IMAGELOADER.getIcon(FileNames.ICON_WARNING); } JLabel iconLabel=new JLabel(icon); JTextPane textPane=new JTextPane(); textPane.setText(warningText); textPane.setEditable(false); textPane.setOpaque(false); JPanel panel=new JPanel(); panel.setLayout(new BoxLayout(panel,BoxLayout.LINE_AXIS)); panel.setBackground(GUIHelper.COLOR_WARNING); panel.add(Box.createRigidArea(new Dimension(8,0))); panel.add(iconLabel); panel.add(Box.createRigidArea(new Dimension(8,0))); panel.add(textPane); panel.add(Box.createRigidArea(new Dimension(8,0))); return panel; }
Example 55
From project nenya, under directory /core/src/main/java/com/threerings/chat/.
Source file: SubtitleChatOverlay.java

/** * Create a subtitle- a line of text that goes on the bottom. */ protected ChatGlyph createSubtitle(Graphics2D gfx,int type,long timestamp,Icon icon,int indent,String text,boolean expires){ Dimension is=new Dimension(); if (icon != null) { is.setSize(icon.getIconWidth(),icon.getIconHeight()); } Rectangle vbounds=_target.getViewBounds(); Label label=_logic.createLabel(text); label.setFont(_logic.getFont(type)); int paddedIconWidth=(icon == null) ? 0 : is.width + ICON_PADDING; label.setTargetWidth(vbounds.width - indent - paddedIconWidth- 2 * (_subtitleXSpacing + Math.max(UIManager.getInt("ScrollBar.width"),PAD))); label.layout(gfx); gfx.dispose(); Dimension ls=label.getSize(); Rectangle r=new Rectangle(0,0,ls.width + indent + paddedIconWidth,Math.max(is.height,ls.height)); r.grow(0,1); Point iconpos=r.getLocation(); iconpos.translate(indent,r.height - is.height - 1); Point labelpos=r.getLocation(); labelpos.translate(indent + paddedIconWidth,1); Rectangle lr=new Rectangle(r.x + indent + paddedIconWidth,r.y,r.width - indent - paddedIconWidth,ls.height + 2); long lifetime=Integer.MAX_VALUE; if (expires) { lifetime=getChatExpire(timestamp,label.getText()) - timestamp; } Shape shape=_logic.getSubtitleShape(type,lr,r); return new ChatGlyph(this,type,lifetime,r.union(shape.getBounds()),shape,icon,iconpos,label,labelpos,_logic.getOutlineColor(type)); }
Example 56
From project niravCS2103, under directory /CS2103/src/gui/mainWindow/extended/.
Source file: LogInDialog.java

/** * set look and feel of this dialog box */ private static void setLook(){ 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(); } }
Example 57
RowHeaderRenderer(JTable table){ JTableHeader header=table.getTableHeader(); setOpaque(true); setBorder(UIManager.getBorder("TableHeader.cellBorder")); setHorizontalAlignment(CENTER); setForeground(header.getForeground()); setBackground(header.getBackground()); setFont(header.getFont()); }
Example 58
From project onebusaway-quickstart, under directory /onebusaway-quickstart-mains/src/main/java/org/onebusaway/quickstart/bootstrap/gui/.
Source file: GtfsPathPanel.java

/** * Create the panel. * @param model */ public GtfsPathPanel(GuiQuickstartDataModel model){ _model=model; setLayout(new MigLayout("","[450px]","[][][]")); JTextPane txtpnWhat=new JTextPane(); txtpnWhat.setEditable(false); txtpnWhat.setBackground(UIManager.getColor("control")); txtpnWhat.setText("OneBusAway reads transit schedule data in the GTFS format. Please specify the path to your GTFS feed so that we can use it to build the OneBusAway transit data bundle."); add(txtpnWhat,"cell 0 0"); gtfsPathTextField=new JCustomTextField(); add(gtfsPathTextField,"cell 0 1,growx"); gtfsPathTextField.setColumns(10); JButton btnNewButton=new JButton(Messages.getString("BundleDirectorySelectionPanel.4")); btnNewButton.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ handleChooseGtfsPath(); } } ); add(btnNewButton,"cell 0 2"); initDataBindings(); gtfsPathTextField.addTextPropertyChangeEvent(); }
Example 59
From project Openbravo-POS-iPhone-App, under directory /UnicentaPOS/src-pos/com/openbravo/pos/config/.
Source file: JFrmConfig.java

/** * @param args the command line arguments */ public static void main(final String args[]){ java.awt.EventQueue.invokeLater(new Runnable(){ public void run(){ AppConfig config=new AppConfig(args); config.load(); try { UIManager.setLookAndFeel(config.getProperty("swing.defaultlaf")); } catch ( Exception e) { } new JFrmConfig(config).setVisible(true); } } ); }
Example 60
From project OpenEMRConnect, under directory /oecsm/src/ke/go/moh/oec/oecsm/gui/.
Source file: DaemonFrame.java

public DaemonFrame(){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); for ( LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } SwingUtilities.updateComponentTreeUI(this); initComponents(); generateDriverList(); getSourceProperties(); getShadowProperties(); } catch ( ClassNotFoundException ex) { Logger logger=Logger.getLogger(DaemonFrame.class.getName()); Logger.getLogger(DaemonFrame.class.getName()).log(Level.SEVERE,null,ex); } catch ( InstantiationException ex) { Logger.getLogger(DaemonFrame.class.getName()).log(Level.SEVERE,null,ex); } catch ( IllegalAccessException ex) { Logger.getLogger(DaemonFrame.class.getName()).log(Level.SEVERE,null,ex); } catch ( UnsupportedLookAndFeelException ex) { Logger.getLogger(DaemonFrame.class.getName()).log(Level.SEVERE,null,ex); } }
Example 61
From project OpenLogViewer, under directory /src/main/java/org/diyefi/openlogviewer/subframes/.
Source file: AboutFrame.java

private void addTextToPanel(final JPanel panel,final String text){ JEditorPane newPane=null; final Font font=UIManager.getFont("Label.font"); final StringBuilder bodyRule=new StringBuilder("body { font-family: "); bodyRule.append(font.getFamily()); bodyRule.append("; font-size: "); bodyRule.append(font.getSize()); bodyRule.append("pt; text-align: center;}"); newPane=new JEditorPane("text/html",text); ((javax.swing.text.html.HTMLDocument)newPane.getDocument()).getStyleSheet().addRule(bodyRule.toString()); newPane.addHyperlinkListener(HLL); newPane.setEditable(false); newPane.setBorder(null); newPane.setOpaque(false); newPane.setAlignmentX(Component.CENTER_ALIGNMENT); panel.add(newPane); }
Example 62
From project org.openscada.external, under directory /org.eclipse.albireo/src/org/eclipse/albireo/core/.
Source file: LookAndFeelHandler.java

private static void doSetLookAndFeel(final String laf) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException { final PrintStream origSystemErr=System.err; try { System.setErr(new PrintStream(origSystemErr){ @Override public void print( final String s){ throw new UnsupportedLookAndFeelRuntimeException(s); } @Override public void println( final String s){ throw new UnsupportedLookAndFeelRuntimeException(s); } } ); UIManager.setLookAndFeel(laf); } catch ( final UnsupportedLookAndFeelRuntimeException e) { final UnsupportedLookAndFeelException newExc=new UnsupportedLookAndFeelException(e.getMessage()); newExc.initCause(e); throw newExc; } finally { System.setErr(origSystemErr); } }
Example 63
From project OWASP-WebScarab, under directory /src/org/owasp/webscarab/util/swing/.
Source file: JTreeTable.java

/** * updateUI is overridden to set the colors of the Tree's renderer to match that of the table. */ public void updateUI(){ super.updateUI(); TreeCellRenderer tcr=getCellRenderer(); if (tcr instanceof DefaultTreeCellRenderer) { DefaultTreeCellRenderer dtcr=((DefaultTreeCellRenderer)tcr); dtcr.setTextSelectionColor(UIManager.getColor("Table.selectionForeground")); dtcr.setBackgroundSelectionColor(UIManager.getColor("Table.selectionBackground")); } }
Example 64
From project PDF-to-unusual-HTML, under directory /PDF-to-unusual-HTML/src/org/apache/pdfbox/.
Source file: PDFDebugger.java

/** * @param args the command line arguments * @throws Exception If anything goes wrong. */ public static void main(String[] args) throws Exception { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); PDFDebugger viewer=new PDFDebugger(); if (args.length > 0) { viewer.readPDFFile(args[0]); } viewer.setVisible(true); }
Example 65
From project PenguinCMS, under directory /PenguinCMS/tests/vendor/sahi/src/net/sf/sahi/ui/.
Source file: Dashboard.java

public Dashboard(){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( Exception e) { e.printStackTrace(); } setTitle("Sahi Dashboard"); startProxy(); buildUI(); addOnExit(); final Dimension dashboardSize=new Dimension(200,225 + 50 + browserTypesHeight); setSize(dashboardSize); setPreferredSize(dashboardSize); refreshTrafficLink(); setVisible(true); }
Example 66
public PipelineWindow(){ super("Pipeliner"); try { String plaf=UIManager.getSystemLookAndFeelClassName(); String gtkLookAndFeel="com.sun.java.swing.plaf.gtk.GTKLookAndFeel"; if (plaf.contains("metal")) { UIManager.setLookAndFeel(gtkLookAndFeel); } UIManager.setLookAndFeel(plaf); } catch ( Exception e) { System.err.println("Could not set look and feel, exception : " + e.toString()); } this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container contentPane=this.getContentPane(); contentPane.setLayout(new BorderLayout()); AnalysisBox analyses=new AnalysisBox(this); centerScrollPane=new JScrollPane(analyses); centerScrollPane.setViewportBorder(BorderFactory.createEmptyBorder()); centerScrollPane.setBorder(BorderFactory.createEmptyBorder(6,6,6,6)); contentPane.add(centerScrollPane,BorderLayout.CENTER); JPanel bottomPanel=new JPanel(); bottomPanel.setLayout(new BorderLayout()); bottomPanel.add(new JSeparator(JSeparator.HORIZONTAL)); contentPane.add(bottomPanel,BorderLayout.SOUTH); this.setSize(500,500); this.setPreferredSize(new Dimension(500,400)); pack(); setLocationRelativeTo(null); }
Example 67
From project PocketMonstersOnline, under directory /SVNClient/src/org/pokenet/updater/.
Source file: PokenetUpdater.java

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(); } setPathForOS(); runApp(); }
Example 68
From project pos_1, under directory /src-pos/com/openbravo/pos/config/.
Source file: JFrmConfig.java

/** * @param args the command line arguments */ public static void main(final String args[]){ java.awt.EventQueue.invokeLater(new Runnable(){ public void run(){ AppConfig config=new AppConfig(args); config.load(); try { UIManager.setLookAndFeel(config.getProperty("swing.defaultlaf")); } catch ( Exception e) { } new JFrmConfig(config).setVisible(true); } } ); }
Example 69
From project QuakeInjector, under directory /src/de/haukerehfeld/quakeinjector/.
Source file: PackageTable.java

/** * Shades alternate rows in different colors. */ public Component prepareRenderer(TableCellRenderer renderer,int row,int column){ Component c=super.prepareRenderer(renderer,row,column); if (isCellSelected(row,column) == false) { c.setBackground(colorForRow(row)); c.setForeground(UIManager.getColor("Table.foreground")); } else { c.setBackground(UIManager.getColor("Table.selectionBackground")); c.setForeground(UIManager.getColor("Table.selectionForeground")); } if (c instanceof JComponent) { if (!(c instanceof PackageListModel.RatingRenderer)) { ((JComponent)c).setBorder(border); } else { ((JComponent)c).setBorder(new EmptyBorder(0,0,0,0)); } } return c; }
Example 70
From project remoting, under directory /src/main/java/hudson/remoting/jnlp/.
Source file: GUI.java

/** * Sets to the platform native look and feel. see http://javaalmanac.com/egs/javax.swing/LookFeelNative.html */ public static void setUILookAndFeel(){ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch ( InstantiationException e) { } catch ( ClassNotFoundException e) { } catch ( UnsupportedLookAndFeelException e) { } catch ( IllegalAccessException e) { } }
Example 71
From project RomRaider, under directory /3rdparty/launch4j/demo/SimpleApp/src/net/sf/launch4j/example/.
Source file: SimpleApp.java

public static void setLAF(){ JFrame.setDefaultLookAndFeelDecorated(true); Toolkit.getDefaultToolkit().setDynamicLayout(true); System.setProperty("sun.awt.noerasebackground","true"); try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch ( Exception e) { System.err.println("Failed to set LookAndFeel"); } }