Posted in Java 12 years ago 2 min read
Windows GUI[/caption]
Tampilan program anda ketika di run
[caption id="" align="alignnone" width="358"]
Program Anda[/caption]
Nah sekarang terlihat kan perbedaannya?
Padahal seharusnya ketika kita menjalankan program kita di Windows, maka tampilan program kita juga harus mengikuti tampilan standar Windows.
JFileChooser Project[/caption]
Pada FileChooser.java tambahkan/sesuaikan dengan code berikut:
public class FileChooser {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
} finally{
new FileChooserForm().setVisible(true);
}
}
}
Sekarang cobalah run ulang project JFileChooser, kini tampilannya telah berubah menjadi lebih baik mengikuti tampilan WIndows.
[caption id="attachment_1872" align="aligncenter" width="358"]
JFileChooser[/caption]
Semoga bermanfaat