溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

如何讓JBuilder的ide使用外觀

發(fā)布時間:2022-01-10 15:39:55 來源:億速云 閱讀:117 作者:iii 欄目:編程語言

本篇內(nèi)容主要講解“如何讓JBuilder的ide使用外觀”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學(xué)習(xí)“如何讓JBuilder的ide使用外觀”吧!

一:準(zhǔn)備工作。
下載Alloy 1.3并生成所需的Alloy.jar(主要是加入一個alloy.properties文件)。

建立目錄E:feelslib (將Alloy.jar放在里面)
  src (存放源文件)
二:編寫所需的類文件。
1.使用Alloy提供的外觀。
這里以AcidTheme為例:

Java">file://AcidThemeAlloyLookAndFeel.java

package soft.wes.feels;

import com.incors.plaf.alloy.*;
import com.incors.plaf.alloy.themes.acid.*;

public class AcidThemeAlloyLookAndFeel extends AlloyLookAndFeel{
 public AcidThemeAlloyLookAndFeel(){
 super(new AcidTheme());
 }
}//end of file
保存上面的文件,注意package??!這里AcidThemeAlloyLookAndFeel.java應(yīng)當(dāng)放在E:feelssrcsoftwesfeels目錄下。
DefaultThemeAlloyLookAndFeel.java, BedouinThemeAlloyLookAndFeel.java, GlassThemeAlloyLookAndFeel.java 與上面的類結(jié)構(gòu)一樣,相信稍有JAVA基礎(chǔ)就可以自己寫出來。
2.使用自定義的外觀。
file://CustomOneAlloyLookAndFeel.java

package soft.wes.feels;

import java.awt.*;
import com.incors.plaf.alloy.*;
import com.incors.plaf.alloy.themes.custom.*;

public class CustomOneAlloyLookAndFeel extends AlloyLookAndFeel{
 
 public CustomOneAlloyLookAndFeel(){
 super(CustomThemeFactory.createTheme(new Color(171, 177, 128),
 new Color(242, 242, 235),
 new Color(100, 103, 92),
 new Color(112, 142, 148),
 new Color(182, 204, 216),
 new Color(180, 208, 213)));
 }
 
}//end of file
將上面的文件保存在E:feelssrcsoftwesfeels 目錄下,程序中各個參數(shù)的具體含義請參考Alloy的api文檔。
三:生成所需的.jar文件。
這里使用ANT編譯并打包。
1.創(chuàng)建build.XML 和 build.properties文件。
build.properties
-----------------------------------------
#常用屬性設(shè)定

src.dir=src
build.dir=build
lib.dir=lib
build.dir.classes=${build.dir}/classes
classes.package = feels.jar
src.package = feels_src.jar
------------------------------------------
build.xml
------------------------------------------

 
 <javac classpath="."
 srcdir="${src.dir}"
 destdir="${build.dir.classes}">

 <jar jarfile = "${classes.package}"
 basedir = "${build.dir.classes}"
 includes = "soft/**">
 
 <jar jarfile = "${src.package}"
 basedir = "${src.dir}"
 includes = "soft/**">


------------------------------------------
關(guān)于ANT的使用,請自行參考相關(guān)的文章。

2.編譯并打包。
首先注意目錄結(jié)構(gòu)如下:
E:feels
  build.properties
  build.xml
  libAlloy.jar
  srcsoftwesfeels
    DefaultThemeAlloyLookAndFeel.java
  BedouinThemeAlloyLookAndFeel.java
  GlassThemeAlloyLookAndFeel.java
  AcidThemeAlloyLookAndFeel.java

運行命令:E:feels>ant
輸出如下:
Buildfile: build.xml

prepare:
  [mkdir] Created dir: E:feelsbuild
  [mkdir] Created dir: E:feelsbuildclasses

compile:
  [javac] Compiling 5 source files to E:feelsbuildclasses

package:
  [jar] Building jar: E:feelsfeels.jar
  [jar] Building jar: E:feelsfeels_src.jar

BUILD SUCCESsfUL
Total time: 12 seconds
四:在JBuilder中使用外觀:
如果你的JBuilder使用的是默認(rèn)的外觀,到Tools/IDE Options/Look and feel:選Metal,切換一下(不切換會找不到下面所說的行)后,關(guān)閉JBuilder(一定要先關(guān)閉)。將Alloy.jar和feels.jar復(fù)制到 JBuilder安裝目錄libext,修改C:Documents and Settingswes.jbuilder7user_zh.properties (wes為當(dāng)前用戶名),找到第8行,修改為:browser;look_and_feel=soft.wes.feels.CustomOneAlloyLookAndFeel(當(dāng)然,可以自由選擇任一個了),保存后退出。
重新啟動JBuilder,就可以欣賞一下自己定制的漂亮的外觀了。

五:說明。
1.上面的方法在Linux平臺也適用,需要修改的配置文件是/root/.jbuilder7/user_zh.properties(假設(shè)當(dāng)前的用戶為root)。
2.顯示的字體,背景,邊框等屬性都是可以修改的,這些就留給大家自己去研究好了,如果你設(shè)計出了超酷的外觀別忘了和大家一起分享呀。
3.如果覺的太靚了,Tools/Editor Options/Color/Editor color scheme: 選Classic,這個方案是最養(yǎng)眼的。
4.注意:修改后最明顯的“負(fù)作用”就是使用中心情愉悅,工作效率明顯提高。

到此,相信大家對“如何讓JBuilder的ide使用外觀”有了更深的了解,不妨來實際操作一番吧!這里是億速云網(wǎng)站,更多相關(guān)內(nèi)容可以進入相關(guān)頻道進行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI