import javax.swing.JFrame;
import javax.swing.UIManager;
public class TryWindows{
//The window object
static JFrame window=new JFrame(\"Hi java\");
public static void main(String[] args){
UIManager.LookAndFeelInfo[] looks=UIManager.getInstalledLookAndFeels();
for(UIManager.LookAndFeelInfo look:looks){
System.out.println(look.getClassName());
}
try{
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeel());
}catch(Exception e){
System.err.println(\"Look and fell not set\");
}
int width=400;// size
int height=400;
window.setBounds(500,100,width,height);//position,size
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.setVisible(true);
}
}
============
symbol : method getCrossPlatformLookAndFeel()
location: class javax.swing.UIManager
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeel());
^
1 error
Tool completed with exit code 1
================
why?
2006-05-09 17:48:55 · 1 個解答 · 發問者 暗黑中的紅月 2 in 電腦與網際網路 ➔ 程式設計
You got the wrong method name. It should like this,UIManager.getCrossPlatformLookAndFeelClassName()
2006-05-11 06:18:45 · answer #1 · answered by ? 7 · 0⤊ 0⤋