Skip to content

Instantly share code, notes, and snippets.

@michalkozminski
Created June 21, 2012 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michalkozminski/2968288 to your computer and use it in GitHub Desktop.
Save michalkozminski/2968288 to your computer and use it in GitHub Desktop.
require 'java'
require 'forms-1.3.0.jar'
require 'miglayout15-swing.jar'
require 'gui.jar'
Java::Gui.main([])
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: net/miginfocom/swing/MigLayout
at Gui.initialize(Gui.java:67)
at Gui.<init>(Gui.java:49)
at Gui$1.run(Gui.java:36)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:682)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:643)
at java.awt.EventQueue$1.run(EventQueue.java:641)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:652)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.ClassNotFoundException: net.miginfocom.swing.MigLayout
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 17 more
import java.awt.EventQueue;
import javax.swing.JFrame;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JLabel;
import javax.swing.JTextField;
import net.miginfocom.swing.MigLayout;
import javax.swing.JComboBox;
import javax.swing.JCheckBox;
import javax.swing.JTabbedPane;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.GridLayout;
import javax.swing.JEditorPane;
public class Gui {
private JFrame frmWebappswordSdk;
private JTextField textField;
private JPanel submodulesPanel;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Gui window = new Gui();
window.frmWebappswordSdk.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public Gui() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frmWebappswordSdk = new JFrame();
frmWebappswordSdk.setTitle("App");
frmWebappswordSdk.setBounds(100, 100, 478, 348);
frmWebappswordSdk.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frmWebappswordSdk.getContentPane().setLayout(new BorderLayout(0, 0));
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.LEFT);
frmWebappswordSdk.getContentPane().add(tabbedPane, BorderLayout.CENTER);
JPanel info = new JPanel();
tabbedPane.addTab("Info", null, info, null);
info.setLayout(new MigLayout("", "[311px][grow]", "[16px][16px][][][grow]"));
JLabel nameLabel = new JLabel("Name");
info.add(nameLabel, "flowx,cell 0 0,alignx left");
textField = new JTextField();
info.add(textField, "cell 1 0,alignx left");
textField.setColumns(20);
JLabel langLabel = new JLabel("Lang");
info.add(langLabel, "cell 0 1,alignx left");
JComboBox comboBox = new JComboBox();
comboBox.setModel(new DefaultComboBoxModel(new String[] {"PHP"}));
info.add(comboBox, "cell 1 1,growx");
JLabel methodsLabel = new JLabel("Methods");
info.add(methodsLabel, "cell 0 2,alignx left");
JCheckBox chckbxNewCheckBox = new JCheckBox("New check box");
info.add(chckbxNewCheckBox, "flowy,cell 1 2");
JLabel submodulesLabel = new JLabel("Submodules");
info.add(submodulesLabel, "cell 0 3,alignx left");
JCheckBox chckbxNewCheckBox_1 = new JCheckBox("New check box");
info.add(chckbxNewCheckBox_1, "cell 1 2");
JButton addSubmoduleButton = new JButton("+");
addSubmoduleButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
System.out.println(textField.getText());
JComboBox comboBox_2 = new JComboBox();
submodulesPanel.add(comboBox_2);
}
});
info.add(addSubmoduleButton, "flowx,cell 1 3,aligny baseline");
submodulesPanel = new JPanel();
info.add(submodulesPanel, "cell 1 4,grow");
submodulesPanel.setLayout(new GridLayout(0, 1, 0, 0));
JComboBox comboBox_2 = new JComboBox();
submodulesPanel.add(comboBox_2);
JPanel installers = new JPanel();
tabbedPane.addTab("Installers", null, installers, null);
installers.setLayout(new GridLayout(0, 1, 0, 0));
JEditorPane editorPane = new JEditorPane();
installers.add(editorPane);
JPanel validators = new JPanel();
tabbedPane.addTab("Validators", null, validators, null);
validators.setLayout(new GridLayout(1, 0, 0, 0));
JEditorPane editorPane_1 = new JEditorPane();
validators.add(editorPane_1);
JMenuBar menuBar = new JMenuBar();
frmWebappswordSdk.getContentPane().add(menuBar, BorderLayout.NORTH);
JMenu mnFile = new JMenu("File");
menuBar.add(mnFile);
JMenuItem mntmNew = new JMenuItem("New");
mnFile.add(mntmNew);
JMenuItem mntmOpen = new JMenuItem("Open");
mnFile.add(mntmOpen);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment