⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lookandfeel.java

📁 漂亮的java swing 界面
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
		    table.put( "Tree.expandedIcon", IconFactory.getTreeExpandedIcon());
		    table.put( "Tree.closedIcon", Utils.loadRes( "/com/flat/icons/TreeDirCerrado.png"));
		    table.put( "Tree.openIcon", Utils.loadRes( "/com/flat/icons/TreeDirAbierto.png"));
		    table.put( "Tree.leafIcon", Utils.loadRes( "/com/flat/icons/TreeFicheroIcon.png"));
		    table.put( "Tree.PelotillaIcon", Utils.loadRes( "/com/flat/icons/TreePelotilla.png"));
		    
		    table.put( "FileView.directoryIcon", Utils.loadRes( "/com/flat/icons/DialogDirCerrado.png"));
		    table.put( "FileView.fileIcon", Utils.loadRes( "/com/flat/icons/DialogFicheroIcon.png"));
		    table.put( "FileView.floppyDriveIcon", Utils.loadRes( "/com/flat/icons/DialogFloppyIcon.png"));
		    table.put( "FileView.hardDriveIcon", Utils.loadRes( "/com/flat/icons/DialogHDIcon.png"));
		    table.put( "FileChooser.newFolderIcon", Utils.loadRes( "/com/flat/icons/DialogNewDir.png"));
		    table.put( "FileChooser.homeFolderIcon", Utils.loadRes( "/com/flat/icons/DialogHome.png"));
		    table.put( "FileChooser.upFolderIcon", Utils.loadRes( "/com/flat/icons/DialogDirParriba.png"));
		    table.put( "FileChooser.detailsViewIcon", Utils.loadRes( "/com/flat/icons/DialogDetails.png"));
		    table.put( "FileChooser.listViewIcon", Utils.loadRes( "/com/flat/icons/DialogList.png"));
		    
		    table.put( "CheckBoxMenuItem.checkIcon", IconFactory.getCheckBoxMenuItemIcon());
		    table.put( "RadioButtonMenuItem.checkIcon", IconFactory.getRadioButtonMenuItemIcon());
		    
		    table.put( "ComboBox.flechaIcon", Utils.loadRes( "/com/flat/icons/ComboButtonDown.png"));
		    table.put( "ComboBox.buttonDownIcon", IconFactory.getComboFlechaIcon());
		    
		    table.put( "Menu.checkIcon", IconFactory.getBandaMenuItemIcon());
		    table.put( "MenuItem.checkIcon", IconFactory.getBandaMenuItemIcon());
		    table.put( "MenuCheckBox.iconBase", Utils.loadRes( "/com/flat/icons/MenuCheckBoxBase.png"));
		    table.put( "MenuCheckBox.iconTick", Utils.loadRes( "/com/flat/icons/MenuCheckBoxTick.png"));
		    table.put( "MenuRadioButton.iconBase", Utils.loadRes( "/com/flat/icons/MenuRadioBase.png"));
		    table.put( "MenuRadioButton.iconTick", Utils.loadRes( "/com/flat/icons/MenuRadioTick.png"));
		    table.put( "CheckBox.iconBase", Utils.loadRes( "/com/flat/icons/CheckBoxBase.png"));
		    table.put( "CheckBox.iconTick", Utils.loadRes( "/com/flat/icons/CheckBoxTick.png"));
		    table.put( "RadioButton.iconBase", Utils.loadRes( "/com/flat/icons/RadioButtonBase.png"));
		    table.put( "RadioButton.iconTick", Utils.loadRes( "/com/flat/icons/RadioButtonTick.png"));
		    
		    // Iconos para los borders generales
		    table.put( "BordeGenSup", Utils.loadRes( "/com/flat/icons/BordeGenSup.png"));
		    table.put( "BordeGenSupDer", Utils.loadRes( "/com/flat/icons/BordeGenSupDer.png"));
		    table.put( "BordeGenDer", Utils.loadRes( "/com/flat/icons/BordeGenDer.png"));
		    table.put( "BordeGenInfDer", Utils.loadRes( "/com/flat/icons/BordeGenInfDer.png"));
		    table.put( "BordeGenInf", Utils.loadRes( "/com/flat/icons/BordeGenInf.png"));
		    table.put( "BordeGenInfIzq", Utils.loadRes( "/com/flat/icons/BordeGenInfIzq.png"));
		    table.put( "BordeGenIzq", Utils.loadRes( "/com/flat/icons/BordeGenIzq.png"));
		    table.put( "BordeGenSupIzq", Utils.loadRes( "/com/flat/icons/BordeGenSupIzq.png"));
		    
		    // Bordes generales
		    table.put( "List.border", Borders.getGenBorder());
		    table.put( "ScrollPane.viewportBorder", Borders.getGenBorder());
		    table.put( "Menu.border", Borders.getGenMenuBorder());
		    table.put( "ToolBar.border", Borders.getToolBarBorder());
		    table.put( "TextField.border", Borders.getTextFieldBorder());
		    table.put( "TextArea.border", Borders.getTextFieldBorder());
		    table.put( "FormattedTextField.border", Borders.getTextFieldBorder());
		    table.put( "PasswordField.border", Borders.getTextFieldBorder());
		    table.put( "ToolTip.border", Borders.getToolTipBorder());
		     
		    table.put( "ScrollPane.border", Borders.getScrollPaneBorder());
		    

		    ColorUIResource col2 = Utils.getColorTercio( LookAndFeel.getFocusColor(),
		                                                      (Color)table.get( "TextField.inactiveBackground"));
		    table.put( "ToolTip.background", col2);
		    table.put( "ToolTip.font", ((Font)table.get( "Menu.font")));
		    
		    table.put( "Spinner.editorBorderPainted", new Boolean( false));
		    table.put( "Spinner.border", Borders.getTextFieldBorder());
		    table.put( "Spinner.arrowButtonBorder", BorderFactory.createEmptyBorder());
		    table.put( "Spinner.nextIcon", IconFactory.getSpinnerNextIcon());
		    table.put( "Spinner.previousIcon", IconFactory.getSpinnerPreviousIcon());
		    
		    table.put( "OptionPane.errorIcon", Utils.loadRes( "/com/flat/icons/Error.png"));
		    table.put( "OptionPane.informationIcon", Utils.loadRes( "/com/flat/icons/Inform.png"));
		    table.put( "OptionPane.warningIcon", Utils.loadRes( "/com/flat/icons/Warn.png"));
		    table.put( "OptionPane.questionIcon", Utils.loadRes( "/com/flat/icons/Question.png"));
		    
		    table.put( "Slider.horizontalThumbIcon", IconFactory.getSliderHorizontalIcon());
		    table.put( "Slider.verticalThumbIcon", IconFactory.getSliderVerticalIcon());
		    table.put( "Slider.horizontalThumbIconImage", Utils.loadRes( "/com/flat/icons/HorizontalThumbIconImage.png"));
		    table.put( "Slider.verticalThumbIconImage", Utils.loadRes( "/com/flat/icons/VerticalThumbIconImage.png"));
		    
		    table.put( "ScrollBar.horizontalThumbIconImage", Utils.loadRes( "/com/flat/icons/HorizontalScrollIconImage.png"));
		    table.put( "ScrollBar.verticalThumbIconImage", Utils.loadRes( "/com/flat/icons/VerticalScrollIconImage.png"));
		    table.put( "ScrollBar.northButtonIconImage", Utils.loadRes( "/com/flat/icons/ScrollBarNorthButtonIconImage.png"));
		    table.put( "ScrollBar.southButtonIconImage", Utils.loadRes( "/com/flat/icons/ScrollBarSouthButtonIconImage.png"));
		    table.put( "ScrollBar.eastButtonIconImage", Utils.loadRes( "/com/flat/icons/ScrollBarEastButtonIconImage.png"));
		    table.put( "ScrollBar.westButtonIconImage", Utils.loadRes( "/com/flat/icons/ScrollBarWestButtonIconImage.png"));
		    table.put( "ScrollBar.northButtonIcon", IconFactory.getScrollBarNorthButtonIcon());
		    table.put( "ScrollBar.southButtonIcon", IconFactory.getScrollBarSouthButtonIcon());
		    table.put( "ScrollBar.eastButtonIcon", IconFactory.getScrollBarEastButtonIcon());
		    table.put( "ScrollBar.westButtonIcon", IconFactory.getScrollBarWestButtonIcon());
		    
		    table.put( "Button.margin", new InsetsUIResource( 5,14, 5,14));
		    table.put( "ToggleButton.margin", new InsetsUIResource( 5,14, 5,14));
		    
		    table.put( "Desktop.background", table.get( "MenuItem.background"));
		    table.put( "InternalFrame.border", Borders.getInternalFrameBorder());
		    
		    table.put( "InternalFrame.NimCloseIcon", Utils.loadRes( "/com/flat/icons/FrameClose.png"));
		    table.put( "InternalFrame.NimCloseIconRoll", Utils.loadRes( "/com/flat/icons/FrameCloseRoll.png"));
		    table.put( "InternalFrame.NimCloseIconPush", Utils.loadRes( "/com/flat/icons/FrameClosePush.png"));
		    
		    table.put( "InternalFrame.NimMaxIcon", Utils.loadRes( "/com/flat/icons/FrameMaximiza.png"));
		    table.put( "InternalFrame.NimMaxIconRoll", Utils.loadRes( "/com/flat/icons/FrameMaximizaRoll.png"));
		    table.put( "InternalFrame.NimMaxIconPush", Utils.loadRes( "/com/flat/icons/FrameMaximizaPush.png"));
		    
		    table.put( "InternalFrame.NimMinIcon", Utils.loadRes( "/com/flat/icons/FrameMinimiza.png"));
		    table.put( "InternalFrame.NimMinIconRoll", Utils.loadRes( "/com/flat/icons/FrameMinimizaRoll.png"));
		    table.put( "InternalFrame.NimMinIconPush", Utils.loadRes( "/com/flat/icons/FrameMinimizaPush.png"));
		    
		    table.put( "InternalFrame.NimResizeIcon", Utils.loadRes( "/com/flat/icons/FrameResize.png"));
		    table.put( "InternalFrame.NimResizeIconRoll", Utils.loadRes( "/com/flat/icons/FrameResizeRoll.png"));
		    table.put( "InternalFrame.NimResizeIconPush", Utils.loadRes( "/com/flat/icons/FrameResizePush.png"));
		    
		    table.put( "InternalFrame.closeIcon", IconFactory.getFrameCloseIcon());
		    table.put( "InternalFrame.minimizeIcon", IconFactory.getFrameAltMaximizeIcon());
		    table.put( "InternalFrame.maximizeIcon", IconFactory.getFrameMaxIcon());
		    table.put( "InternalFrame.iconifyIcon", IconFactory.getFrameMinIcon());
		    table.put( "InternalFrame.icon", Utils.loadRes( "/com/flat/icons/Frame.png"));
		    table.put( "NimRODInternalFrameIconLit.width", new Integer( 20));
		    table.put( "NimRODInternalFrameIconLit.height", new Integer( 20));
		    
		    Font fontIcon = ((Font)table.get( "InternalFrame.titleFont")).deriveFont( Font.BOLD);
		    table.put( "DesktopIcon.font", fontIcon);
		    table.put( "NimRODDesktopIcon.width", new Integer( 80));
		    table.put( "NimRODDesktopIcon.height", new Integer( 60));
		    table.put( "NimRODDesktopIconBig.width", new Integer( 48));
		    table.put( "NimRODDesktopIconBig.height", new Integer( 48));
		    
		    table.put( "InternalFrame.activeTitleBackground", getMenuSelectedBackground());
		    table.put( "InternalFrame.activeTitleGradient", getMenuSelectedBackground().darker());
		    table.put( "InternalFrame.inactiveTitleBackground", getMenuBackground().brighter());
		    table.put( "InternalFrame.inactiveTitleGradient", getMenuBackground().darker());
	}
	@Override
	protected void initSystemColorDefaults(UIDefaults arg0) {
		super.initSystemColorDefaults( arg0);

		arg0.put( "textHighlight", getMenuSelectedBackground());
	    
		arg0.put( "textInactiveText", getInactiveSystemTextColor().darker());
	}
	 public boolean isNativeLookAndFeel() {
		    return false;
	 }

	 public boolean isSupportedLookAndFeel() {
	    return true;
	 }
	 public boolean getSupportsWindowDecorations() {
		    return false;
	 }
	@Override
	protected void initClassDefaults(UIDefaults table) {
		// TODO Auto-generated method stub
		super.initClassDefaults(table);
		table.put( "ButtonUI", "com.flat.ButtonUI");
		table.put( "ComboBoxUI", "com.flat.ComboBoxUI");
		table.put( "SplitPaneUI", "com.flat.SplitPaneUI");
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -