Netbeans UI beautification and font setting

Source: Internet
Author: User
Tags netbeans java se
Document directory
  • Install the latest JDK
  • Install cleartype adjustment tool
  • Modify netbeans startup settings
  • Modify Java font configurations
  • Success
  • Related posts

In Chinese Windows, the default netbeans interface and font are a bit ugly and need to be optimized.

 

Install the latest JDK

You must install Java SE Development Kit (JDK) 6 Update 10 or an updated version. Earlier versions do not support font anti-aliasing.

: Http://java.sun.com/javase/downloads/index.jsp

 

 

Install cleartype adjustment tool

Cleartype tuner powertoy is used to adjust the advanced settings of cleartype font anti-sawtooth. You can adjust the font display to a rough one, so it does not look tired.

: Http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx

 

 

Modify netbeans startup settings

Open the netbeans. conf file in the C:/program files/netbeans 6.5/etc/directory and find:

 

# Options used by NetBeans launcher by default, can be overridden by explicit# command line switches:netbeans_default_options=.....

 

InNetbeans_default_optionsAdded to the parameter string--Fontsize 12 -- LAF javax. Swing. plaf. Metal. metallookandfeel. It looks like:

 

# Options used by NetBeans launcher by default, can be overridden by explicit# command line switches:netbeans_default_options="-J-client -J-Xverify:none -J-Xss2m -J-Xms32m    -J-XX:PermSize=32m -J-XX:MaxPermSize=200m    -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=false    --fontsize 12 --laf javax.swing.plaf.metal.MetalLookAndFeel"

 

-- Fontsize 12 indicates that the page font is changed to 12 o'clock size, which meets Chinese display requirements.

-- LAF javax. Swing. plaf. Metal. metallookandfeel is the interface topic that requires netbeans to use native non-operating systems. However, I am used to this. I don't like to add this part to the command line parameters.

Of course, here-fontsize 12 can also be replaced by another command:

-J-Dswing.useSystemFontSettings = false

 

 

Modify Java font configurations

Open the C:/program files/Java/jdk1.6.0 _ 11/JRE/lib directoryFontconfig.98.bfcAndFontconfig.98.properties. SRCThe two files are renamed or deleted.

ThenFontconfig. Properties. SRCCopy one copyFontconfig. PropertiesAnd open it in a text editor.Fontconfig. PropertiesFile.

The purpose of modifying the font configuration file is to allow Java programs to use different fonts when displaying Chinese and English characters. For example, a piece of code:

 

/The control View File corresponding to the rendering result through the control view * is View/_ controls/footer_control.php. */$ This-> _ renderblock ('footer ', $ return );

 

The Chinese part uses, and the English part uses consolas. The display effect is as follows:

To achieve this effect, you need to modify the font file in three places. They are:

  • Font File Name definition: determines the correspondence between the font name and the font file name.
  • Relationship between the virtual font and the actual Font: determine the actual font used to display the virtual font
  • Font search order when displaying characters: determines the font used when displaying characters

The font file name is in the following format. You can define your favorite font as needed, but you cannot use a Chinese font name.

Find "# font file names" and add it below:

 

# Filename. font name = font file name filename. Las las = La. ttffilename. consolas_bold = lab. ttffilename. consolas_italic = Lai. ttffilename. consolas_bold_italic = pailaz. TTF

 

 

After defining the font name, you can specify the correspondence between the virtual font and the actual font.

For example, if I direct the default monospaced virtual font to the consolas font just defined, modify the settings as follows:

 

Monospaced. plain. alphabetic = courier newmonospaced. bold. alphabetic = Courier New boldmonospaced. italic. alphabetic = Courier New italicmonospaced. bolditalic. alphabetic = Courier New bold italic # changed to monospaced. plain. alphabetic = consolasmonospaced. bold. alphabetic = maid. italic. alphabetic = las italicmonospaced. bolditalic. alphabetic = maid bold ttalic

 

Finally, modify the font search order. After the modification, the system looks for the English font and then the Chinese font. Because there is no Chinese font in the English font, the English and Chinese fonts are displayed in different fonts.

 

Sequence. monospaced. GBK = chinese-ms936, alphabetic, dingbats, symbolsequence. monospaced. gb18030 = chinese-gb18030, alphabetic, dingbats, symbol # changed to sequence. monospaced. GBK = alphabetic, chinese-ms936, dingbats, symbolsequence. monospaced. gb18030 = alphabetic, chinese-gb18030, dingbats, symbol

 

 

 

Success

After all the work is done, restart netbeans. The effect is very good:

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.