I use swingui because it is really easy and is able to support the mutlibyte characters, but I want create a custom theme for my game, is ti possible? I want some guy give me a suggestion, thanks.
JME don't support mutli byte character, so I want use java to call the windows api to draw bitmap using windows font library and render this bitmap on screen, if this way works, i could only use node and textue create my own interface.
Search for 'Look and feel' in a general java forum or google to find information on how to edit it.
使用quaqua 美化 Quaqua Look and Feel
an example:
import java.awt.;
import javax.swing.;
import ch.randelshofer.quaqua.util.Methods;
class MyPanel extends JPanel {
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2=(Graphics2D)g;
Font f1=new Font("Serif", Font.BOLD, 36);
g2.setFont(f1);
g2.drawString("Serif, BOLD, 36 Point", 20, 40);
Font f2=new Font("Times New Roman", Font.ITALIC, 30);
g2.setFont(f2);
g2.drawString("Times New Roman, ITALIC, 30 Point", 20, 70);
Font f3=new Font("宋体", Font.BOLD+Font.ITALIC, 24);
g2.setFont(f3);
g2.drawString("宋体, BOLD+ITALIC, 24 Point", 20, 100);
}
}
public class TestQuaqua extends JFrame {
public TestQuaqua() {
setSize(500, 200);
setTitle("TestQuaqua JFrame");
MyPanel panel=new MyPanel();
add(panel);
}
public static void main(String[] args) {
// Turn on look and feel decoration when not running on Mac OS X or Darwin.
/*如果使用的不是MAC OS X系统,需要显示的调用
Methods.invokeStatic(JFrame.class, "setDefaultLookAndFeelDecorated", Boolean.TYPE, Boolean.TRUE);
Methods.invokeStatic(JDialog.class, "setDefaultLookAndFeelDecorated", Boolean.TYPE, Boolean.TRUE);
来更改窗体样式。
*/
System.setProperty("Quaqua.tabLayoutPolicy", "wrap");
if (!System.getProperty("os.name").toLowerCase().startsWith("mac") &&
! System.getProperty("os.name").toLowerCase().startsWith("darwin")) {
try {
Methods.invokeStatic(JFrame.class, "setDefaultLookAndFeelDecorated", Boolean.TYPE, Boolean.TRUE);
Methods.invokeStatic(JDialog.class, "setDefaultLookAndFeelDecorated", Boolean.TYPE, Boolean.TRUE);
}
catch (NoSuchMethodException e) {
e.printStackTrace();
}
}
try {
//改变整体风格
UIManager.setLookAndFeel("ch.randelshofer.quaqua.QuaquaLookAndFeel");
}
catch (Exception e) {
e.printStackTrace();
}
// Launch the test program
SwingUtilities.invokeLater(new Runnable() {
public void run() {
TestQuaqua thisclass=new TestQuaqua();
thisclass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
thisclass.setVisible(true);
}
});
}
}