90 likes | 232 Views
Change the Look & Feel Compiere Looks. 凡操千曲而後曉聲 , 觀千劍而後識器 , 故圓照之象務先博觀 . 劉勰 文心雕龍. 井民全製作. 參考資料 : http://www.compiere.org/looks/index.html. Outline. Snapshoot Compiere Looks Overview Program Demo 一般背景 把圖當 JPanel 的背景 Resource. Snapshoot. Compiere Looks Overview.
E N D
Change the Look & FeelCompiere Looks 凡操千曲而後曉聲,觀千劍而後識器,故圓照之象務先博觀. 劉勰 文心雕龍 井民全製作 參考資料: http://www.compiere.org/looks/index.html
Outline • Snapshoot • Compiere Looks Overview • Program Demo • 一般背景 • 把圖當JPanel的背景 • Resource
Compiere Looks Overview • Home: http://www.compiere.org/looks/index.html • 3D color extension of the Java Metal pluggable Look and Feel. • add color capabilities as well as texture backgrounds • Open Source (based on JDK 1.4.0)
Program Demo import org.compiere.plaf.*; import org.compiere.swing.*; import org.compiere.util.*; public class MyFrame{ public MyFrame(){ setSize(300,300); Container c=getContentPane(); show(); } } public class Demo{ public static void main(String args[]){ MyFrame win=new MyFrame(); } } CompierePLAF.setPLAF(this); MyPanel=new CPanel(new CompiereColor(Color.green,Color.cyan)); c.add(MyPanel); MyPanel.add(new CButton(“test”)); MyPanel.add(new CButton(“test”));
Program Demo把圖當JPanel的背景 public class Demo{ public static void main(String args[]){ MyFrame win=new MyFrame(); } } import org.compiere.plaf.*; import org.compiere.swing.*; import org.compiere.util.*; public class MyFrame{ public MyFrame(){ setSize(300,300); Container c=getContentPane(); } } CompiereColor MyBG=new CompiereColor(Color.green,false); CButton myButton=new CButton("Ok"); myButton.setBackgroundColor(MyBG); MyPanel.add(myButton); myButton=new CButton("Cancel"); myButton.setBackgroundColor(MyBG); MyPanel.add(myButton); MyPanel=new CPanel(new CompiereColor(new File ("c:/texture.jpg").toURL(),Color.blue,(float)0.3)); c.add(MyPanel); CompierePLAF.setPLAF(this); 重要程式片段 重要程式片段
Resource • Download • http://www.compiere.org/looks/download.html • API Doc • http://compiere.sourceforge.net/doc/API_Looks/
Other Available JFC/Swing PLAFs • http://www.javootoo.com • http://www.incors.org(Kuststoff) • http://www.jgoodies.com(jGoodies) • http://www.l2fprod.com(SkinLF) • http://www.themes.org(GTK Themes)
Test Design Prototype End • “Facts” to remember • Users can’t remember • Users can’t read • Users can’t control the Mouse • Users do the unexpected