Jgoodies no class defined error [message #1865691] |
Thu, 09 May 2024 07:34 |
germ yum Messages: 1 Registered: May 2024 |
Junior Member |
|
|
i installed window builder and tried to run a simple program but it didn't compile and threw an error saying - "Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/jgoodies/common/base/Preconditions"
--the code --
package testing;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.LookAndFeel;
import javax.swing.UIManager;
import com.formdev.flatlaf.intellijthemes.FlatArcDarkIJTheme;
import com.formdev.flatlaf.themes.FlatMacDarkLaf;
import java.awt.Font;
import javax.swing.JButton;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
public class test {
private JFrame frame;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel(new FlatMacDarkLaf());
test window = new test();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public test() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 675, 516);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(new FormLayout(new ColumnSpec[] {
ColumnSpec.decode("72px"),
ColumnSpec.decode("320px"),},
new RowSpec[] {
RowSpec.decode("187px"),
RowSpec.decode("68px"),
RowSpec.decode("76px"),
RowSpec.decode("38px"),}));
JLabel lblNewLabel = new JLabel("Hello world");
lblNewLabel.setFont(new Font("Times New Roman", Font.PLAIN, 22));
frame.getContentPane().add(lblNewLabel, "2, 2, fill, fill");
JButton btnNewButton = new JButton("New button");
frame.getContentPane().add(btnNewButton, "2, 4, fill, fill");
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.03331 seconds