List of usage examples for javax.swing UIManager put
public static Object put(Object key, Object value)
From source file:misc.TablePrintDemo1.java
/** * Start the application.//from w w w . jav a 2 s . c o m */ public static void main(final String[] args) { /* Schedule for the GUI to be created and shown on the EDT */ SwingUtilities.invokeLater(new Runnable() { public void run() { /* Don't want bold fonts if we end up using metal */ UIManager.put("swing.boldMetal", false); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { } new TablePrintDemo1().setVisible(true); } }); }
From source file:edu.harvard.i2b2.query.ui.QueryTopPanel.java
/** Creates new form QueryTopPanel */ public QueryTopPanel(QueryPanel parent) { parentPanel = parent;/*from w ww . j a v a2 s . c o m*/ dataModel = parent.dataModel(); UIManager.put("Label.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("Button.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("TextField.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("CheckBox.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("RadioButton.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("Tree.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("ComboBox.font", new Font("Tahoma", Font.PLAIN, 11)); initComponents(); jGetPatientCountCheckBox.setSelected(true); jShowTimelineCheckBox.setSelected(true); addComponentListener(new java.awt.event.ComponentAdapter() { @Override public void componentMoved(java.awt.event.ComponentEvent evt) { // formComponentMoved(evt); } @Override public void componentResized(java.awt.event.ComponentEvent evt) { // formComponentResized(evt); // System.out.println("waiting panel resizing ..."); int width = (getParent().getWidth()); int height = (getParent().getHeight()); if (width < 5 || height < 5) { return; } resizePanels(width, height); // log.info("width: "+width+", height: "+height); if (firsttime) { firsttime = false; resizePanels(width, height + 3); // log.info("second width: "+width+", height: "+(height+3)); } } }); }
From source file:misc.TextBatchPrintingDemo.java
public static void main(String[] args) { final TextBatchPrintingDemo demo = new TextBatchPrintingDemo(); demo.homePage = demo.getClass().getResource(defaultPage); // Custom home page can be specified on the command line. if (args.length > 0) { String pageName = args[0]; try {//from w w w . j a v a2 s .c o m URL url = new URL(pageName); demo.homePage = url; } catch (MalformedURLException e) { System.out.println("Error parsing " + pageName + ": " + e); // Home page is unchanged from the default value. } } //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); demo.createAndShowGUI(); } }); }
From source file:edu.harvard.i2b2.query.ui.TopPanel.java
/** Creates new form QueryTopPanel */ public TopPanel(QueryPanel parent) { parentPanel = parent;/*from ww w . java 2 s . c om*/ dataModel = parent.dataModel(); UIManager.put("Label.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("Button.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("TextField.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("CheckBox.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("RadioButton.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("Tree.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("ComboBox.font", new Font("Tahoma", Font.PLAIN, 11)); initComponents(); // jGetPatientCountCheckBox.setSelected(true); // jShowTimelineCheckBox.setSelected(true); addComponentListener(new java.awt.event.ComponentAdapter() { @Override public void componentMoved(java.awt.event.ComponentEvent evt) { // formComponentMoved(evt); } @Override public void componentResized(java.awt.event.ComponentEvent evt) { // formComponentResized(evt); // System.out.println("waiting panel resizing ..."); int width = (getParent().getWidth()); int height = (getParent().getHeight()); if (width < 5 || height < 5) { return; } resizePanels(width, height); // log.info("width: "+width+", height: "+height); if (firsttime) { firsttime = false; resizePanels(width, height + 3); // log.info("second width: "+width+", height: "+(height+3)); } } }); }
From source file:edu.harvard.i2b2.query.ui.MainPanel.java
/** Creates new form QueryTopPanel */ public MainPanel(QueryToolPanel parent) { parentPanel = parent;//from w ww .ja va2 s . c om dataModel = parent.dataModel(); UIManager.put("Label.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("Button.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("TextField.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("CheckBox.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("RadioButton.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("Tree.font", new Font("Tahoma", Font.PLAIN, 11)); UIManager.put("ComboBox.font", new Font("Tahoma", Font.PLAIN, 11)); initComponents(); // jGetPatientCountCheckBox.setSelected(true); // jShowTimelineCheckBox.setSelected(true); addComponentListener(new java.awt.event.ComponentAdapter() { @Override public void componentMoved(java.awt.event.ComponentEvent evt) { // formComponentMoved(evt); } @Override public void componentResized(java.awt.event.ComponentEvent evt) { // formComponentResized(evt); // System.out.println("waiting panel resizing ..."); int width = (getParent().getWidth()); int height = (getParent().getHeight()); if (width < 5 || height < 5) { return; } resizePanels(width, height); // log.info("width: "+width+", height: "+height); if (firsttime) { firsttime = false; resizePanels(width, height + 3); // log.info("second width: "+width+", height: "+(height+3)); } } }); }
From source file:org.obiba.onyx.jade.instrument.summitdoppler.VantageABIInstrumentRunner.java
@Override public void afterPropertiesSet() throws Exception { log.info("Setting anklebrachial-locale to {}", getLocale().getDisplayLanguage()); resourceBundle = ResourceBundle.getBundle("anklebrachial-instrument", getLocale()); // Turn off metal's use of bold fonts UIManager.put("swing.boldMetal", Boolean.FALSE); appWindow = new JFrame(resourceBundle.getString("Title.VantageABI")); saveButton.setToolTipText(resourceBundle.getString("ToolTip.Save_and_return")); saveButton.setText(resourceBundle.getString("Save")); saveButton.setEnabled(false);// w w w . j a v a 2 s. c o m }
From source file:com.limegroup.gnutella.gui.themes.setters.SubstanceThemeSetter.java
public void apply() { SubstanceLookAndFeel.setSkin(_skinClassName); ThemeMediator.applyCommonSkinUI();//from w ww.j a v a 2s . co m float scaledFontPolicyFactor = WINDOWS_SCALED_FONT_POLICY_FACTOR; if (OSUtils.isMacOSX()) { scaledFontPolicyFactor = MAC_SCALED_FONT_POLICY_FACTOR; } else if (OSUtils.isLinux()) { scaledFontPolicyFactor = LINUX_SCALED_FONT_POLICY_FACTOR; } if (LookUtils.IS_OS_WINDOWS) { fixWindowsOSFont(); } else if (LookUtils.IS_OS_LINUX) { fixLinuxOSFont(); } SubstanceLookAndFeel.setFontPolicy(SubstanceFontUtilities.getScaledFontPolicy(scaledFontPolicyFactor)); //reduceFont("Label.font"); //reduceFont("Table.font"); //ResourceManager.setFontSizes(-1); //ResourceManager.setFontSizes(0); UIManager.put("Tree.leafIcon", UIManager.getIcon("Tree.closedIcon")); // remove split pane borders UIManager.put("SplitPane.border", BorderFactory.createEmptyBorder()); if (!OSUtils.isMacOSX()) { UIManager.put("Table.focusRowHighlightBorder", UIManager.get("Table.focusCellHighlightBorder")); } UIManager.put("Table.focusCellHighlightBorder", BorderFactory.createEmptyBorder(1, 1, 1, 1)); // Add a bold text version of simple text. Font normal = UIManager.getFont("Table.font"); FontUIResource bold = new FontUIResource(normal.getName(), Font.BOLD, normal.getSize()); UIManager.put("Table.font.bold", bold); UIManager.put("Tree.rowHeight", 0); }
From source file:com.qspin.qtaste.ui.MainPanel.java
public void setQSpinTheme() { mTheme = new QSpinTheme(); MetalLookAndFeel.setCurrentTheme(mTheme); try {/*from www .j a v a 2s.co m*/ UIManager.setLookAndFeel(new MetalLookAndFeel()); ((WrappedToolTipUI) WrappedToolTipUI.createUI(null)).setMaxWidth(200); UIManager.put("ToolTipUI", "com.qspin.qtaste.ui.tools.WrappedToolTipUI"); } catch (UnsupportedLookAndFeelException ex) { } }
From source file:com.freedomotic.jfrontend.MainWindow.java
/** * * @param master/*from w w w . ja va2s . c om*/ */ public MainWindow(final JavaDesktopFrontend master) { this.i18n = master.getApi().getI18n(); UIManager.put("OptionPane.yesButtonText", i18n.msg("yes")); UIManager.put("OptionPane.noButtonText", i18n.msg("no")); UIManager.put("OptionPane.cancelButtonText", i18n.msg("cancel")); this.master = master; this.api = master.getApi(); this.auth = api.getAuth(); ObjectEditor.setAPI(api); setWindowedMode(); updateMenusPermissions(); String defEnv = master.getApi().getConfig().getProperty("KEY_ROOM_XML_PATH"); EnvironmentLogic env = api.environments() .findOne(defEnv.substring(defEnv.length() - 41, defEnv.length() - 5)); setEnvironment(env); checkDeletableEnvironments(); KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager(); manager.addKeyEventDispatcher(new MyDispatcher()); }
From source file:MainProgram.MainProgram.java
public static void setUIFont(javax.swing.plaf.FontUIResource f) { java.util.Enumeration keys = UIManager.getDefaults().keys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); Object value = UIManager.get(key); if (value instanceof javax.swing.plaf.FontUIResource) { UIManager.put(key, f); }//w w w . java2 s .c o m } }