这是我的简单应用程序:
public class MainFrame extends JFrame{
private Dimension size;
private JPanel buttonPanel;
private JButton button;
public MainFrame() throws ClassNotFoundException{
super("Applikacja1");
try {
UIManager.setLookAndFeel("com.formdev.flatlaf.FlatDarkLaf");
} catch (Exception ex) {
}
JFrame.setDefaultLookAndFeelDecorated(true);
size = new Dimension(350, 530);
setPreferredSize(size);
setMinimumSize(size);
setLocationRelativeTo(null);
setLayout(new BorderLayout());
pack();
//setting button
button = new JButton("Start programu");
button.setVisible(true);
this.add(button);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
setResizable(false);
}
}
Run Code Online (Sandbox Code Playgroud)

我需要做什么才能将该程序的外观更改为 FlatLaf 并使用他们的库?我需要从互联网下载什么?我尝试下载整个代码(从这里https://www.formdev.com/flatlaf/),然后将其作为库添加到 netbeans 中,但它不起作用。有人可以做一个完全新手的教程吗?