下载本文示例代码
大家常常说JBuilder在中文系统中存在光标错位的问题,都认为这是JBuilder的一个Bug,其实这实在是冤枉JBuilder了!大家讨论出来的解决方法无外乎两种: 1、将编辑器的字体改为宋体,用这种方法带来的问题是,在宋体下的英文字体实在难看,阅读起来不太顺眼; 2、就是将编辑器字体的粗体属性去掉,这样也影响代码的可读性。 其实,造成JBuilder光标错位的问题并不是Borland的错误,而是Java的宗师——Sun的罪过!大家一定知道i18n吧?在不同的区域设置中,JDK自动调用与之相对应的properties文件,而在JDK中,Sun所推出的与中文系统相对应的properties文件存在问题,在它之中没有区分英文字体的正常、粗体和斜体,从而导致了以上所说的问题,解决的方法很简单,只要将这个properties文件修改正确就可以了,修改方法如下:在jre/lib目录中找到font.properties.zh文件,编辑这个文件并修改成如下内容:
# @(#)font.properties.zh1.16 00/10/06## AWT Font default Properties for Chinese Windows#dialog.plain.0=Arial,ANSI_CHARSETdialog.plain.1=\u5b8b\u4f53,GB2312_CHARSETdialog.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDdialog.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDdialog.bold.0=Arial Bold,ANSI_CHARSETdialog.bold.1=\u5b8b\u4f53,GB2312_CHARSETdialog.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDdialog.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDdialog.italic.0=Arial Italic,ANSI_CHARSETdialog.italic.1=\u5b8b\u4f53,GB2312_CHARSETdialog.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDdialog.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDdialog.bolditalic.0=Arial Bold Italic,ANSI_CHARSETdialog.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSETdialog.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDdialog.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDdialoginput.plain.0=Courier New,ANSI_CHARSETdialoginput.plain.1=\u5b8b\u4f53,GB2312_CHARSETdialoginput.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDdialoginput.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDdialoginput.bold.0=Courier New Bold,ANSI_CHARSETdialoginput.bold.1=\u5b8b\u4f53,GB2312_CHARSETdialoginput.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDdialoginput.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDdialoginput.italic.0=Courier New Italic,ANSI_CHARSETdialoginput.italic.1=\u5b8b\u4f53,GB2312_CHARSETdialoginput.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDdialoginput.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDdialoginput.bolditalic.0=Courier New Bold Italic,ANSI_CHARSETdialoginput.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSETdialoginput.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDdialoginput.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDserif.plain.0=Times New Roman,ANSI_CHARSETserif.plain.1=\u5b8b\u4f53,GB2312_CHARSETserif.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDserif.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDserif.bold.0=Times New Roman Bold,ANSI_CHARSETserif.bold.1=\u5b8b\u4f53,GB2312_CHARSETserif.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDserif.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDserif.italic.0=Times New Roman Italic,ANSI_CHARSETserif.italic.1=\u5b8b\u4f53,GB2312_CHARSETserif.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDserif.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDserif.bolditalic.0=Times New Roman Bold Italic,ANSI_CHARSETserif.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSETserif.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDserif.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDsansserif.plain.0=Arial,ANSI_CHARSETsansserif.plain.1=\u5b8b\u4f53,GB2312_CHARSETsansserif.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDsansserif.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDsansserif.bold.0=Arial Bold,ANSI_CHARSETsansserif.bold.1=\u5b8b\u4f53,GB2312_CHARSETsansserif.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDsansserif.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDsansserif.italic.0=Arial Italic,ANSI_CHARSETsansserif.italic.1=\u5b8b\u4f53,GB2312_CHARSETsansserif.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDsansserif.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDsansserif.bolditalic.0=Arial Bold Italic,ANSI_CHARSETsansserif.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSETsansserif.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDsansserif.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDmonospaced.plain.0=Courier New,GB2312_CHARSETmonospaced.plain.1=\u5b8b\u4f53,GB2312_CHARSETmonospaced.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDmonospaced.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDmonospaced.bold.0=Courier New Bold,GB2312_CHARSETmonospaced.bold.1=\u5b8b\u4f53,GB2312_CHARSETmonospaced.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDmonospaced.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDmonospaced.italic.0=Courier New Italic,GB2312_CHARSETmonospaced.italic.1=\u5b8b\u4f53,GB2312_CHARSETmonospaced.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDmonospaced.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDmonospaced.bolditalic.0=Courier New Bold Italic,GB2312_CHARSETmonospaced.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSETmonospaced.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDmonospaced.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED# name aliases##alias.timesroman=serif#alias.helvetica=sansserif#alias.courier=monospaced# for backward compatibility#timesroman.0=Times New Roman,ANSI_CHARSET#helvetica.0=Arial,ANSI_CHARSET#courier.0=Courier New,ANSI_CHARSETzapfdingbats.0=WingDings,SYMBOL_CHARSET# font filenames for reduced initialization time#filename.\u5b8b\u4f53=SIMSUN.TTFfilename.Arial=ARIAL.TTFfilename.Arial_Bold=ARIALBD.TTFfilename.Arial_Italic=ARIALI.TTFfilename.Arial_Bold_Italic=ARIALBI.TTFfilename.Courier_New=COUR.TTFfilename.Courier_New_Bold=COURBD.TTFfilename.Courier_New_Italic=COURI.TTFfilename.Courier_New_Bold_Italic=COURBI.TTFfilename.Times_New_Roman=TIMES.TTFfilename.Times_New_Roman_Bold=TIMESBD.TTFfilename.Times_New_Roman_Italic=TIMESI.TTFfilename.Times_New_Roman_Bold_Italic=TIMESBI.TTFfilename.WingDings=WINGDING.TTFfilename.Symbol=SYMBOL.TTF# Default font definition#default.char=2751# Static FontCharset info.##fontcharset.dialog.0=sun.io.CharToByteCp1252fontcharset.dialog.1=sun.io.CharToByteGBKfontcharset.dialog.2=sun.awt.windows.CharToByteWingDingsfontcharset.dialog.3=sun.awt.CharToByteSymbol#fontcharset.dialoginput.0=sun.io.CharToByteCp1252fontcharset.dialoginput.1=sun.io.CharToByteGBKfontcharset.dialoginput.2=sun.awt.windows.CharToByteWingDingsfontcharset.dialoginput.3=sun.awt.CharToByteSymbol#fontcharset.serif.0=sun.io.CharToByteCp1252fontcharset.serif.1=sun.io.CharToByteGBKfontcharset.serif.2=sun.awt.windows.CharToByteWingDingsfontcharset.serif.3=sun.awt.CharToByteSymbol#fontcharset.sansserif.0=sun.io.CharToByteCp1252fontcharset.sansserif.1=sun.io.CharToByteGBKfontcharset.sansserif.2=sun.awt.windows.CharToByteWingDingsfontcharset.sansserif.3=sun.awt.CharToByteSymbol#fontcharset.monospaced.0=sun.io.CharToByteCp1252fontcharset.monospaced.1=sun.io.CharToByteGBKfontcharset.monospaced.2=sun.awt.windows.CharToByteWingDingsfontcharset.monospaced.3=sun.awt.CharToByteSymbol# Exclusion Range info.#exclusion.dialog.plain.0=00a0-f8ffexclusion.dialog.italic.0=00a0-f8ffexclusion.dialog.bold.0=00a0-f8ffexclusion.dialog.bolditalic.0=00a0-f8ffexclusion.dialoginput.plain.0=00a0-f8ffexclusion.dialoginput.italic.0=00a0-f8ffexclusion.dialoginput.bold.0=00a0-f8ffexclusion.dialoginput.bolditalic.0=00a0-f8ffexclusion.serif.plain.0=00a0-f8ffexclusion.serif.italic.0=00a0-f8ffexclusion.serif.bold.0=00a0-f8ffexclusion.serif.bolditalic.0=00a0-f8ffexclusion.sansserif.plain.0=00a0-f8ffexclusion.sansserif.italic.0=00a0-f8ffexclusion.sansserif.bold.0=00a0-f8ffexclusion.sansserif.bolditalic.0=00a0-f8ffexclusion.monospaced.italic.0=00a0-f8ffexclusion.monospaced.bold.0=00a0-f8ffexclusion.monospaced.bolditalic.0=00a0-f8ff# charset for text input# inputtextcharset=GB2312_CHARSET 保存后,一切问题就解决了! 这种方法也适用于任何相同的问题。 [题外话]这种错误SUN真的应该好好反省一下了,希望以后他们做的东西能够测试更好一些。zmbbs=1;
大家常常说JBuilder在中文系统中存在光标错位的问题,都认为这是JBuilder的一个Bug,其实这实在是冤枉JBuilder了!大家讨论出来的解决方法无外乎两种: 1、将编辑器的字体改为宋体,用这种方法带来的问题是,在宋体下的英文字体实在难看,阅读起来不太顺眼; 2、就是将编辑器字体的粗体属性去掉,这样也影响代码的可读性。 其实,造成JBuilder光标错位的问题并不是Borland的错误,而是Java的宗师——Sun的罪过!大家一定知道i18n吧?在不同的区域设置中,JDK自动调用与之相对应的properties文件,而在JDK中,Sun所推出的与中文系统相对应的properties文件存在问题,在它之中没有区分英文字体的正常、粗体和斜体,从而导致了以上所说的问题,解决的方法很简单,只要将这个properties文件修改正确就可以了,修改方法如下:在jre/lib目录中找到font.properties.zh文件,编辑这个文件并修改成如下内容:
# @(#)font.properties.zh1.16 00/10/06## AWT Font default Properties for Chinese Windows#dialog.plain.0=Arial,ANSI_CHARSETdialog.plain.1=\u5b8b\u4f53,GB2312_CHARSETdialog.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDdialog.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDdialog.bold.0=Arial Bold,ANSI_CHARSETdialog.bold.1=\u5b8b\u4f53,GB2312_CHARSETdialog.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDdialog.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDdialog.italic.0=Arial Italic,ANSI_CHARSETdialog.italic.1=\u5b8b\u4f53,GB2312_CHARSETdialog.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDdialog.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDdialog.bolditalic.0=Arial Bold Italic,ANSI_CHARSETdialog.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSETdialog.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDdialog.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDdialoginput.plain.0=Courier New,ANSI_CHARSETdialoginput.plain.1=\u5b8b\u4f53,GB2312_CHARSETdialoginput.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDdialoginput.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDdialoginput.bold.0=Courier New Bold,ANSI_CHARSETdialoginput.bold.1=\u5b8b\u4f53,GB2312_CHARSETdialoginput.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDdialoginput.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDdialoginput.italic.0=Courier New Italic,ANSI_CHARSETdialoginput.italic.1=\u5b8b\u4f53,GB2312_CHARSETdialoginput.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDdialoginput.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDdialoginput.bolditalic.0=Courier New Bold Italic,ANSI_CHARSETdialoginput.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSETdialoginput.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDdialoginput.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDserif.plain.0=Times New Roman,ANSI_CHARSETserif.plain.1=\u5b8b\u4f53,GB2312_CHARSETserif.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDserif.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDserif.bold.0=Times New Roman Bold,ANSI_CHARSETserif.bold.1=\u5b8b\u4f53,GB2312_CHARSETserif.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDserif.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDserif.italic.0=Times New Roman Italic,ANSI_CHARSETserif.italic.1=\u5b8b\u4f53,GB2312_CHARSETserif.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDserif.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDserif.bolditalic.0=Times New Roman Bold Italic,ANSI_CHARSETserif.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSETserif.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDserif.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDsansserif.plain.0=Arial,ANSI_CHARSETsansserif.plain.1=\u5b8b\u4f53,GB2312_CHARSETsansserif.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDsansserif.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDsansserif.bold.0=Arial Bold,ANSI_CHARSETsansserif.bold.1=\u5b8b\u4f53,GB2312_CHARSETsansserif.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDsansserif.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDsansserif.italic.0=Arial Italic,ANSI_CHARSETsansserif.italic.1=\u5b8b\u4f53,GB2312_CHARSETsansserif.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDsansserif.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDsansserif.bolditalic.0=Arial Bold Italic,ANSI_CHARSETsansserif.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSETsansserif.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDsansserif.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDmonospaced.plain.0=Courier New,GB2312_CHARSETmonospaced.plain.1=\u5b8b\u4f53,GB2312_CHARSETmonospaced.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDmonospaced.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDmonospaced.bold.0=Courier New Bold,GB2312_CHARSETmonospaced.bold.1=\u5b8b\u4f53,GB2312_CHARSETmonospaced.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDmonospaced.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDmonospaced.italic.0=Courier New Italic,GB2312_CHARSETmonospaced.italic.1=\u5b8b\u4f53,GB2312_CHARSETmonospaced.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDmonospaced.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTEDmonospaced.bolditalic.0=Courier New Bold Italic,GB2312_CHARSETmonospaced.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSETmonospaced.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTEDmonospaced.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED# name aliases##alias.timesroman=serif#alias.helvetica=sansserif#alias.courier=monospaced# for backward compatibility#timesroman.0=Times New Roman,ANSI_CHARSET#helvetica.0=Arial,ANSI_CHARSET#courier.0=Courier New,ANSI_CHARSETzapfdingbats.0=WingDings,SYMBOL_CHARSET# font filenames for reduced initialization time#filename.\u5b8b\u4f53=SIMSUN.TTFfilename.Arial=ARIAL.TTFfilename.Arial_Bold=ARIALBD.TTFfilename.Arial_Italic=ARIALI.TTFfilename.Arial_Bold_Italic=ARIALBI.TTFfilename.Courier_New=COUR.TTFfilename.Courier_New_Bold=COURBD.TTFfilename.Courier_New_Italic=COURI.TTFfilename.Courier_New_Bold_Italic=COURBI.TTFfilename.Times_New_Roman=TIMES.TTFfilename.Times_New_Roman_Bold=TIMESBD.TTFfilename.Times_New_Roman_Italic=TIMESI.TTFfilename.Times_New_Roman_Bold_Italic=TIMESBI.TTFfilename.WingDings=WINGDING.TTFfilename.Symbol=SYMBOL.TTF# Default font definition#default.char=2751# Static FontCharset info.##fontcharset.dialog.0=sun.io.CharToByteCp1252fontcharset.dialog.1=sun.io.CharToByteGBKfontcharset.dialog.2=sun.awt.windows.CharToByteWingDingsfontcharset.dialog.3=sun.awt.CharToByteSymbol#fontcharset.dialoginput.0=sun.io.CharToByteCp1252fontcharset.dialoginput.1=sun.io.CharToByteGBKfontcharset.dialoginput.2=sun.awt.windows.CharToByteWingDingsfontcharset.dialoginput.3=sun.awt.CharToByteSymbol#fontcharset.serif.0=sun.io.CharToByteCp1252fontcharset.serif.1=sun.io.CharToByteGBKfontcharset.serif.2=sun.awt.windows.CharToByteWingDingsfontcharset.serif.3=sun.awt.CharToByteSymbol#fontcharset.sansserif.0=sun.io.CharToByteCp1252fontcharset.sansserif.1=sun.io.CharToByteGBKfontcharset.sansserif.2=sun.awt.windows.CharToByteWingDingsfontcharset.sansserif.3=sun.awt.CharToByteSymbol#fontcharset.monospaced.0=sun.io.CharToByteCp1252fontcharset.monospaced.1=sun.io.CharToByteGBKfontcharset.monospaced.2=sun.awt.windows.CharToByteWingDingsfontcharset.monospaced.3=sun.awt.CharToByteSymbol# Exclusion Range info.#exclusion.dialog.plain.0=00a0-f8ffexclusion.dialog.italic.0=00a0-f8ffexclusion.dialog.bold.0=00a0-f8ffexclusion.dialog.bolditalic.0=00a0-f8ffexclusion.dialoginput.plain.0=00a0-f8ffexclusion.dialoginput.italic.0=00a0-f8ffexclusion.dialoginput.bold.0=00a0-f8ffexclusion.dialoginput.bolditalic.0=00a0-f8ffexclusion.serif.plain.0=00a0-f8ffexclusion.serif.italic.0=00a0-f8ffexclusion.serif.bold.0=00a0-f8ffexclusion.serif.bolditalic.0=00a0-f8ffexclusion.sansserif.plain.0=00a0-f8ffexclusion.sansserif.italic.0=00a0-f8ffexclusion.sansserif.bold.0=00a0-f8ffexclusion.sansserif.bolditalic.0=00a0-f8ffexclusion.monospaced.italic.0=00a0-f8ffexclusion.monospaced.bold.0=00a0-f8ffexclusion.monospaced.bolditalic.0=00a0-f8ff# charset for text input# inputtextcharset=GB2312_CHARSET 保存后,一切问题就解决了! 这种方法也适用于任何相同的问题。 [题外话]这种错误SUN真的应该好好反省一下了,希望以后他们做的东西能够测试更好一些。zmbbs=1;
下载本文示例代码
JBuilder光标问题的解决方案JBuilder光标问题的解决方案JBuilder光标问题的解决方案JBuilder光标问题的解决方案JBuilder光标问题的解决方案JBuilder光标问题的解决方案JBuilder光标问题的解决方案JBuilder光标问题的解决方案JBuilder光标问题的解决方案JBuilder光标问题的解决方案JBuilder光标问题的解决方案JBuilder光标问题的解决方案JBuilder光标问题的解决方案JBuilder光标问题的解决方案JBuilder光标问题的解决方案