本文整理汇总了Java中javax.swing.UIManager.put方法的典型用法代码示例。如果您正苦于以下问题:Java UIManager.put方法的具体用法?Java UIManager.put怎么用?Java UIManager.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.UIManager
的用法示例。
在下文中一共展示了UIManager.put方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: colorB_actionPerformed
import javax.swing.UIManager; //导入方法依赖的package包/类
void colorB_actionPerformed(ActionEvent e) {
// Fix until Sun's JVM supports more locales...
UIManager.put(
"ColorChooser.swatchesNameText",
Local.getString("Swatches"));
UIManager.put("ColorChooser.hsbNameText", Local.getString("HSB"));
UIManager.put("ColorChooser.rgbNameText", Local.getString("RGB"));
UIManager.put(
"ColorChooser.swatchesRecentText",
Local.getString("Recent:"));
UIManager.put("ColorChooser.previewText", Local.getString("Preview"));
UIManager.put(
"ColorChooser.sampleText",
Local.getString("Sample Text")
+ " "
+ Local.getString("Sample Text"));
UIManager.put("ColorChooser.okText", Local.getString("OK"));
UIManager.put("ColorChooser.cancelText", Local.getString("Cancel"));
UIManager.put("ColorChooser.resetText", Local.getString("Reset"));
UIManager.put("ColorChooser.hsbHueText", Local.getString("H"));
UIManager.put("ColorChooser.hsbSaturationText", Local.getString("S"));
UIManager.put("ColorChooser.hsbBrightnessText", Local.getString("B"));
UIManager.put("ColorChooser.hsbRedText", Local.getString("R"));
UIManager.put("ColorChooser.hsbGreenText", Local.getString("G"));
UIManager.put("ColorChooser.hsbBlueText", Local.getString("B2"));
UIManager.put("ColorChooser.rgbRedText", Local.getString("Red"));
UIManager.put("ColorChooser.rgbGreenText", Local.getString("Green"));
UIManager.put("ColorChooser.rgbBlueText", Local.getString("Blue"));
Color c = JColorChooser.showDialog(this, Local.getString("Font color"),
Util.decodeColor(colorField.getText()));
if (c == null) return;
colorField.setText(Util.encodeColor(c));
Util.setColorField(colorField);
sample.setForeground(c);
}
示例2: setBackgroundImage
import javax.swing.UIManager; //导入方法依赖的package包/类
public void setBackgroundImage(Image image) {
if (image != null) {
final ImageIcon icon = new ImageIcon(image);
logoSize = new Dimension(icon.getIconWidth(), icon.getIconHeight());
final BufferedImage img =
ImageUtils.createCompatibleTranslucentImage(logoSize.width,
logoSize.height);
Graphics2D g = img.createGraphics();
g.setColor(Color.white);
g.fillRect(0, 0, icon.getIconWidth(), icon.getIconHeight());
g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5F));
icon.paintIcon(null, g, 0, 0);
g.dispose();
UIManager.put("wizard.sidebar.image", img); //$NON-NLS-1$
}
}
示例3: initClassDefaults
import javax.swing.UIManager; //导入方法依赖的package包/类
@Override
public void initClassDefaults(UIDefaults table) {
super.initClassDefaults(table);
table.putDefaults(new Object[] { "ButtonUI",
XDMButtonUI.class.getName(), "ScrollBarUI",
XDMScrollBarUI.class.getName(), "MenuItemUI",
XDMMenuItemUI.class.getName(), "MenuUI",
XDMMenuUI.class.getName(), "CheckBoxMenuItemUI",
XDMMenuItemUI.class.getName(), "TreeUI",
XDMTreeUI.class.getName(), "SpinnerUI",
XDMSpinnerUI.class.getName(), "ProgressBarUI",
XDMProgressBarUI.class.getName(), "ComboBoxUI",
XDMComboBoxUI.class.getName() // ,
// "TabbedPaneUI",
// BasicTabbedPaneUI.class.getName()
});
System.setProperty("xdm.defaulttheme", "true");
UIManager.put("TabbedPane.selected", new Color(220, 220, 220));
UIManager.put("TabbedPane.borderHightlightColor", Color.LIGHT_GRAY);
UIManager.put("TabbedPane.contentAreaColor", Color.LIGHT_GRAY);
UIManager.put("TabbedPane.contentOpaque", Boolean.FALSE);
UIManager.put("Table.focusCellHighlightBorder", new EmptyBorder(1, 1,
1, 1));
UIManager.put("OptionPane.background", new ColorUIResource(Color.WHITE));
UIManager.put("Panel.background", new ColorUIResource(Color.WHITE));
UIManager.put("CheckBox.background", new ColorUIResource(Color.WHITE));
}
示例4: getJxdatetimepickerDaysOfTheWeekForeground
import javax.swing.UIManager; //导入方法依赖的package包/类
public static Color getJxdatetimepickerDaysOfTheWeekForeground() {
Color managerColor = UIManager.getColor("nb.dataview.jxdatetimepicker.daysOfTheWeekForeground");
if (managerColor == null) {
if (isDarkTheme()) {
UIManager.put("nb.dataview.jxdatetimepicker.daysOfTheWeekForeground", new RelativeColor(new Color(0, 0, 0), new Color(0, 0, 0), "Table.background")); //NOI18N
} else {
UIManager.put("nb.dataview.jxdatetimepicker.daysOfTheWeekForeground", UIManager.getColor("JXMonthView.daysOfTheWeekForeground"));
}
return UIManager.getColor("nb.dataview.jxdatetimepicker.daysOfTheWeekForeground"); //NOI18N
} else {
return managerColor;
}
}
示例5: getJxdatetimepickerForeground
import javax.swing.UIManager; //导入方法依赖的package包/类
public static Color getJxdatetimepickerForeground() {
Color managerColor = UIManager.getColor("nb.dataview.jxdatetimepicker.foreground");
if (managerColor == null) {
if(isDarkTheme()) {
UIManager.put("nb.dataview.jxdatetimepicker.foreground", new RelativeColor(new Color(0, 0, 0), new Color(0, 0, 0), "Table.foreground")); //NOI18N
} else {
UIManager.put("nb.dataview.jxdatetimepicker.foreground", UIManager.getColor("JXMonthView.foreground"));
}
return UIManager.getColor("nb.dataview.jxdatetimepicker.foreground"); //NOI18N
} else {
return managerColor;
}
}
示例6: browseB_actionPerformed
import javax.swing.UIManager; //导入方法依赖的package包/类
/**
* setup the JFileChooser so the user can select the resource file
*/
void browseB_actionPerformed(ActionEvent e) {
// Fix until Sun's JVM supports more locales...
UIManager.put("FileChooser.lookInLabelText", Local.getString("Look in:"));
UIManager.put("FileChooser.upFolderToolTipText", Local.getString("Up One Level"));
UIManager.put("FileChooser.newFolderToolTipText", Local.getString("Create New Folder"));
UIManager.put("FileChooser.listViewButtonToolTipText", Local.getString("List"));
UIManager.put("FileChooser.detailsViewButtonToolTipText", Local.getString("Details"));
UIManager.put("FileChooser.fileNameLabelText", Local.getString("File Name:"));
UIManager.put("FileChooser.filesOfTypeLabelText", Local.getString("Files of Type:"));
UIManager.put("FileChooser.openButtonText", Local.getString("Open"));
UIManager.put("FileChooser.openButtonToolTipText", Local.getString("Open selected file"));
UIManager.put("FileChooser.cancelButtonText", Local.getString("Cancel"));
UIManager.put("FileChooser.cancelButtonToolTipText", Local.getString("Cancel"));
JFileChooser chooser = new JFileChooser();
chooser.setFileHidingEnabled(false);
chooser.setDialogTitle(Local.getString("Add resource"));
chooser.setAcceptAllFileFilterUsed(true);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
chooser.setPreferredSize(new Dimension(550, 375));
/*
* java.io.File lastSel = (java.io.File)
* Context.get("LAST_SELECTED_RESOURCE_FILE"); if (lastSel != null)
* chooser.setCurrentDirectory(lastSel);
*/
if (chooser.showOpenDialog(this) != JFileChooser.APPROVE_OPTION)
return;
/*
* try { Context.put("LAST_SELECTED_RESOURCE_FILE",
* chooser.getSelectedFile()); } catch (Exception ex) {}
*/
pathField.setText(chooser.getSelectedFile().getPath());
checkOkEnabled();
}
示例7: selectAppBrowseB_actionPerformed
import javax.swing.UIManager; //导入方法依赖的package包/类
void selectAppBrowseB_actionPerformed(ActionEvent e) {
// Fix until Sun's JVM supports more locales...
UIManager.put("FileChooser.lookInLabelText", Local.getString("Look in:"));
UIManager.put("FileChooser.upFolderToolTipText", Local.getString("Up One Level"));
UIManager.put("FileChooser.newFolderToolTipText", Local.getString("Create New Folder"));
UIManager.put("FileChooser.listViewButtonToolTipText", Local.getString("List"));
UIManager.put("FileChooser.detailsViewButtonToolTipText", Local.getString("Details"));
UIManager.put("FileChooser.fileNameLabelText", Local.getString("File Name:"));
UIManager.put("FileChooser.filesOfTypeLabelText", Local.getString("Files of Type:"));
UIManager.put("FileChooser.openButtonText", Local.getString("Open"));
UIManager.put("FileChooser.openButtonToolTipText", Local.getString("Open selected file"));
UIManager.put("FileChooser.cancelButtonText", Local.getString("Cancel"));
UIManager.put("FileChooser.cancelButtonToolTipText", Local.getString("Cancel"));
UIManager.put("FileChooser.acceptAllFileFilterText", Local.getString("All Files") + " (*.*)");
JFileChooser chooser = new JFileChooser();
chooser.setDialogTitle(Local.getString("Path to executable"));
chooser.setFileHidingEnabled(false);
chooser.setAcceptAllFileFilterUsed(true);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
if (System.getProperty("os.name").startsWith("Win")) {
chooser.setFileFilter(new AllFilesFilter(AllFilesFilter.EXE));
chooser.setCurrentDirectory(new File("C:\\Program Files"));
}
chooser.setPreferredSize(new Dimension(550, 375));
/*
java.io.File lastSel = (java.io.File) Context.get("LAST_SELECTED_IMPORT_FILE");
if (lastSel != null)
chooser.setCurrentDirectory(lastSel);
*/
if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
applicationField.setText(chooser.getSelectedFile().getPath());
}
示例8: main
import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
UIManager.put("FileChooser.openButtonMnemonic", KeyEvent.VK_O);
UIManager.put("FileChooser.saveButtonMnemonic", KeyEvent.VK_S);
runTest();
break;
}
}
}
示例9: test
import javax.swing.UIManager; //导入方法依赖的package包/类
void test() {
int size = UIManager.getDefaults().size();
// create a new value, size increases
UIManager.getLookAndFeelDefaults().put(KEY, VALUE);
check(KEY, VALUE, true, size + 1);
// override the value, size remains the same
UIManager.put(KEY, VALUE);
check(KEY, VALUE, true, size + 1);
// remove the value, size decreases
UIManager.getDefaults().remove(KEY);
check(KEY, null, false, size);
}
示例10: changeSkin
import javax.swing.UIManager; //导入方法依赖的package包/类
/**
* 更换皮肤
*/
public static void changeSkin()
{
try
{
//UIManager.put("nimbusBase", Color.red);
//UIManager.put("nimbusBlueGrey", Color.red);//按钮的颜色
UIManager.put("control", new Color(215, 255, 255));//控件背景色
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
}
catch (Exception e)
{
e.printStackTrace();
}
}
示例11: getJxdatetimepickerBackground
import javax.swing.UIManager; //导入方法依赖的package包/类
public static Color getJxdatetimepickerBackground() {
Color managerColor = UIManager.getColor("nb.dataview.jxdatetimepicker.background");
if (managerColor == null) {
if(isDarkTheme()) {
UIManager.put("nb.dataview.jxdatetimepicker.background", new RelativeColor(new Color(0, 0, 0), new Color(0, 0, 0), "Table.background")); //NOI18N
} else {
UIManager.put("nb.dataview.jxdatetimepicker.background", UIManager.getColor("JXMonthView.background"));
}
return UIManager.getColor("nb.dataview.jxdatetimepicker.background"); //NOI18N
} else {
return managerColor;
}
}
示例12: browseB_actionPerformed
import javax.swing.UIManager; //导入方法依赖的package包/类
/**
* setup the JFileChooser so the user can select the resource file
*/
void browseB_actionPerformed(ActionEvent e) {
// Fix until Sun's JVM supports more locales...
UIManager.put("FileChooser.lookInLabelText",
Local.getString("Look in:"));
UIManager.put("FileChooser.upFolderToolTipText",
Local.getString("Up One Level"));
UIManager.put("FileChooser.newFolderToolTipText",
Local.getString("Create New Folder"));
UIManager.put("FileChooser.listViewButtonToolTipText",
Local.getString("List"));
UIManager.put("FileChooser.detailsViewButtonToolTipText",
Local.getString("Details"));
UIManager.put("FileChooser.fileNameLabelText",
Local.getString("File Name:"));
UIManager.put("FileChooser.filesOfTypeLabelText",
Local.getString("Files of Type:"));
UIManager.put("FileChooser.openButtonText",
Local.getString("Open"));
UIManager.put("FileChooser.openButtonToolTipText",
Local.getString("Open selected file"));
UIManager.put("FileChooser.cancelButtonText",
Local.getString("Cancel"));
UIManager.put("FileChooser.cancelButtonToolTipText",
Local.getString("Cancel"));
JFileChooser chooser = new JFileChooser();
chooser.setFileHidingEnabled(false);
chooser.setDialogTitle(Local.getString("Add resource"));
chooser.setAcceptAllFileFilterUsed(true);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
chooser.setPreferredSize(new Dimension(550, 375));
/*java.io.File lastSel = (java.io.File) Context.get("LAST_SELECTED_RESOURCE_FILE");
if (lastSel != null)
chooser.setCurrentDirectory(lastSel);*/
if (chooser.showOpenDialog(this) != JFileChooser.APPROVE_OPTION)
return;
/*try {
Context.put("LAST_SELECTED_RESOURCE_FILE", chooser.getSelectedFile());
}
catch (Exception ex) {}*/
pathField.setText(chooser.getSelectedFile().getPath());
checkOkEnabled();
}
示例13: getBaseMap
import javax.swing.UIManager; //导入方法依赖的package包/类
public int getBaseMap() {
ButtonGroup bg = new ButtonGroup();
mapsTB = new JToggleButton[MapApp.SUPPORTED_MAPS.size()];
maps = new int[MapApp.SUPPORTED_MAPS.size()];
JPanel panel2 = new JPanel( new FlowLayout() );
UIManager.put("ToggleButton.shadow", Color.decode("#7EA5C6"));
UIManager.put ("ToggleButton.select",
(Color) UIManager.get ("ToggleButton.shadow"));
int i = 0;
for (Iterator<Integer> iter = MapApp.SUPPORTED_MAPS.iterator(); iter.hasNext();) {
int map = iter.next().intValue();
mapsTB[i] = getMapToggleButton(map);
maps[i] = map;
bg.add(mapsTB[i]);
mapsTB[i].addActionListener( this);
panel2.add( mapsTB[i] );
i++;
}
mapsTB[initialMapSelection].setSelected(true);
JPanel panel = new JPanel( new BorderLayout() );
panel.add(panel2);
JLabel label = new JLabel( "Choose a Base Map Projection: ");
label.setForeground( Color.black);
selected = new JLabel( NAMES.get(new Integer(maps[initialMapSelection])).toString() + " Selected" + '\n');
selected.setForeground( Color.decode("#496781"));
JPanel panelN = new JPanel( new BorderLayout() );
panelN.add(label, "West");
panelN.add(selected);
panelN.add(new JLabel("version " + haxby.map.MapApp.VERSION), "East");
panel.add( panelN,"North" );
JPanel southPanel1 = new JPanel( new GridLayout(0,1) );
infoLabel = new JLabel("<html>Created By: William F. Haxby <font size=2>('03-'06)</font>, William B.F. Ryan <font size=2>('03-present)</font></font>" +
"<br>Developers: Neville Shane <font size=2>('16-present)</font>, Justin Coplan <font size=2>('04-'11)</font>, Sze-Man(Samantha) Chan <font size=2>('09-'15)</font>, Andrew K. Melkonian <font size=2>('06-'09)</font>,<br>	 Donald E. Pomeroy <font size=2>('11-'12)</font>" +
"<br>Funded By: National Science Foundation & Trustees of Columbia University" +
"<br><br><center><font color=#CC3333>The Displayed Maps, Images, Data Tables are not to be used for Navigation Purposes.</font></center></html>");
southPanel1.add(infoLabel);
JPanel panelS = new JPanel( new BorderLayout() );
panelS.add(southPanel1,"North");
panel.add(panelS,"South");
// Control over button dialogs. Default to Agree Selection
Object[] options = {"Agree","Cancel"};
// Signify if running in Development Mode
String devText = "";
if(MapApp.BASE_URL.matches(MapApp.DEV_URL))
devText = "**DEVELOPMENT MODE** ";
int ok = JOptionPane.showOptionDialog( null, panel, devText + "Choose a Base Map Projection",
JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE, null,
options,
options[0]);
if(ok == JOptionPane.YES_OPTION) {
for (i = 0; i < mapsTB.length; i++) {
if (mapsTB[i].isSelected())
ok = maps[i];
mapsTB[i] = null;
}
}else {
ok = -1;
}
return ok;
}
示例14: bgColorB_actionPerformed
import javax.swing.UIManager; //导入方法依赖的package包/类
void bgColorB_actionPerformed(ActionEvent e) {
// Fix until Sun's JVM supports more locales...
UIManager.put(
"ColorChooser.swatchesNameText",
Local.getString("Swatches"));
UIManager.put("ColorChooser.hsbNameText", Local.getString("HSB"));
UIManager.put("ColorChooser.rgbNameText", Local.getString("RGB"));
UIManager.put(
"ColorChooser.swatchesRecentText",
Local.getString("Recent:"));
UIManager.put("ColorChooser.previewText", Local.getString("Preview"));
UIManager.put(
"ColorChooser.sampleText",
Local.getString("Sample Text")
+ " "
+ Local.getString("Sample Text"));
UIManager.put("ColorChooser.okText", Local.getString("OK"));
UIManager.put("ColorChooser.cancelText", Local.getString("Cancel"));
UIManager.put("ColorChooser.resetText", Local.getString("Reset"));
UIManager.put("ColorChooser.hsbHueText", Local.getString("H"));
UIManager.put("ColorChooser.hsbSaturationText", Local.getString("S"));
UIManager.put("ColorChooser.hsbBrightnessText", Local.getString("B"));
UIManager.put("ColorChooser.hsbRedText", Local.getString("R"));
UIManager.put("ColorChooser.hsbGreenText", Local.getString("G"));
UIManager.put("ColorChooser.hsbBlueText", Local.getString("B2"));
UIManager.put("ColorChooser.rgbRedText", Local.getString("Red"));
UIManager.put("ColorChooser.rgbGreenText", Local.getString("Green"));
UIManager.put("ColorChooser.rgbBlueText", Local.getString("Blue"));
Color initColor = Util.decodeColor(bgcolorField.getText());
Color c =
JColorChooser.showDialog(
this,
Local.getString("Table background color"),
initColor);
if (c == null)
return;
bgcolorField.setText(
"#" + Integer.toHexString(c.getRGB()).substring(2).toUpperCase());
Util.setBgcolorField(bgcolorField);
}
示例15: init
import javax.swing.UIManager; //导入方法依赖的package包/类
public void init() {
UIManager.put("Label.font", new Font("Perpetua", 0, 36)); // NON-NLS: property and font names
add(new JColorChooser(Color.LIGHT_GRAY));
}