Export to GitHub

beautyeye - Introduction_en.wiki


Step 1:How to start?

File beautyeye_lnf.jar should go under YOUR_PROJECT/lib and added to build path.
Notes: beautyeye_lnf.jar is located all_in_on/dist/ which place all_in_one.zip to unpack


Step 2:How to use BeautyEye L&F in my code?

Add the following code to your Java project,the GUI look and feel styles will replaced the BeautyEye L&F:

public static void main(String[] args)
{
try
{
org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();
}
catch(Exception e)
{
//TODO exception
}
..................... your code .........................
..................... your code .........................
}



Appendix 1:Method to setting frame window border style.

public static void main(String[] args)
{
try
{
//frame window border style here
BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.osLookAndFeelDecorated;
org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();
}
catch(Exception e)
{
//TODO exception
}
..................... your code .........................
..................... your code .........................
}

Appendix 2:Frame window border style list.

# Border style code BeautyEye test on jdk Screenshot 1 System default FrameBorderStyle.osLookAndFeelDecorated 2 Powerful modeling translucence border FrameBorderStyle.translucencyAppleLike java1.6.0_u10 or higher 3 Weak modeling translucence border FrameBorderStyle.translucencySmallShadow 4 Nomarl opacity border FrameBorderStyle.generalNoTranslucencyShadow java1.5

Appendix 3:How to use different color buttons?

No Code Default in BeautyEye Effect 1 btnInstance.setUI(new BEButtonUI().setNormalColor(BEButtonUI.NormalColor.normal)); YES 2 btnInstance.setUI(new BEButtonUI().setNormalColor(BEButtonUI.NormalColor.green)); 3 btnInstance.setUI(new BEButtonUI().setNormalColor(BEButtonUI.NormalColor.lightBlue)); 4 btnInstance.setUI(new BEButtonUI().setNormalColor(BEButtonUI.NormalColor.blue)); 5 btnInstance.setUI(new BEButtonUI().setNormalColor(BEButtonUI.NormalColor.red));

Appendix 4:How to hide “设置” button?

http://beautyeye.googlecode.com/svn/trunk/beautyeye_lnf/screenshots/y1.png' />

Note: This button is only as a demo window title button ability of custom now,the future will open the custom function,you can choose hide it now.

    UIManager.put("RootPane.setupButtonVisible", false);

Appendix 5:How to open/close the translucent effect when window inactive?

@since v3.2

//Set this switch is "false",is means close it. It's default "true" in BeautyEye LNF.
BeautyEyeLNFHelper.translucencyAtFrameInactive = false;

Appendix 6:How to keep the JToolBar UI using conventional solid color to fill the background and never use gradient images?

@since v3.4

http://beautyeye.googlecode.com/svn/trunk/beautyeye_lnf/screenshots/toolbar_bg_paint_contrast.png' />

Method 1:

//Set properties:"true" means used "ToolBar.background" corol fill the background
//This is "false" in BeautyEye's default setting.
UIManager.put("ToolBar.isPaintPlainBackground", Boolean.TRUE);

Method 2:

//Use ClientProperty Separate settings control every toolbar:"true"means use ToolBar.background
//This is "false" in BeautyEye's default setting.
toolbarInstance.putClientProperty("ToolBar.isPaintPlainBackground", Boolean.TRUE);

Note: Method 2 can control every JToolBar component,but Method 1 Is global properties,Method 2's priority is higher than Method 1.

Appendix 7:How to define JToolBar ui's border?

@since v3.4

Put in the following code to use your own border:

//Custom JToolBar ui's border
Border bd = new org.jb2011.lnf.beautyeye.ch8_toolbar.BEToolBarUI.ToolBarBorder(
UIManager.getColor("ToolBar.shadow") //When Floatable contact's color
, UIManager.getColor("ToolBar.highlight")//When Floatable contact's shadow color
, new Insets(6, 0, 11, 0)); //Border's default insets
UIManager.put("ToolBar.border",new BorderUIResource(bd));

Note: The abover code must be follow “BeautyEyeLNFHelper.launchBeautyEyeLNF();”so that can work well.



Appendix 8:How to set JTabbedPane's left indent in BeantuEye?

http://beautyeye.googlecode.com/svn/trunk/beautyeye_lnf/screenshots/tab_indent_desc_pic.png' />

You can easy to realize by following codes:

//Change InsetsUIResource's parameters can realize
UIManager.put("TabbedPane.tabAreaInsets"
, new javax.swing.plaf.InsetsUIResource(3,20,2,20));

Note: The abover code must be follow “BeautyEyeLNFHelper.launchBeautyEyeLNF();”so that can work well.

Appendix 9:How to set background transparent and completely hide the title bar for a frame?

http://beautyeye.googlecode.com/svn/trunk/beautyeye_lnf/screenshots/help_about_trasparent.png' />

Transfer the following code before you frame has be setVisible(true):

// set frame full transparent
frame.setUndecorated(true);
AWTUtilities.setWindowOpaque(frame, false);
frame.getRootPane().setWindowDecorationStyle(JRootPane.NONE);

NOte: The abover code apply to all frame'title include official MetalLookAndFeel

except system's.



Appendix 10:API Document

http://beautyeye.googlecode.com/svn/trunk/beautyeye_lnf/doc/api_doc/index.html'>Online reading or http://code.google.com/p/beautyeye/downloads/list'>Download all_in_one

Appendix 11:Why can't use BeautyEye L&F to make the window transparent with java1.6.0_10 or update 11 versions?

Because this versions has a Bug,concreteness:https://code.google.com/p/beautyeye/wiki/java_1_6_0_u10_BUG_6750920'>Look at here.

Appendix 12:Specification for text font breezing problem on some Java version of Windows 7

Please specific look at https://code.google.com/p/beautyeye/issues/detail?id=25'>issue 25

Solution: Change the default font to Microsoft Accor black (win7's default font),The font effect will be greatly improved.

/**The key be related to font of UIManager's UI */
public static String[] DEFAULT_FONT = new String[]{
"Table.font"
,"TableHeader.font"
,"CheckBox.font"
,"Tree.font"
,"Viewport.font"
,"ProgressBar.font"
,"RadioButtonMenuItem.font"
,"ToolBar.font"
,"ColorChooser.font"
,"ToggleButton.font"
,"Panel.font"
,"TextArea.font"
,"Menu.font"
,"TableHeader.font"
// ,"TextField.font"
,"OptionPane.font"
,"MenuBar.font"
,"Button.font"
,"Label.font"
,"PasswordField.font"
,"ScrollPane.font"
,"MenuItem.font"
,"ToolTip.font"
,"List.font"
,"EditorPane.font"
,"Table.font"
,"TabbedPane.font"
,"RadioButton.font"
,"CheckBoxMenuItem.font"
,"TextPane.font"
,"PopupMenu.font"
,"TitledBorder.font"
,"ComboBox.font"
};
// Change default font.
for (int i = 0; i < SwingUtils.DEFAULT_FONT.length; i++)
UIManager.put(SwingUtils.DEFAULT_FONT[i],new Font("微软雅黑", Font.PLAIN,14));

Appendix 13:Specification for window's contentPane become transparent by uesed BeautyEye

First of all declare,this is not BeautyEye's bug,actually this is official's Window Transparency come true,JFrame(include JDialog)'scontentPane actually is JPanel,it is considered be a part of window,it has be transparented when other component be transparented by official's Window Transparency API(I did not see the source code,it is not exactly now.).But it is reasonable,because it will be able to make transparent you also have never thought of the scene.

Solution: Add a new JPanel on contentPane.