Note that there are some explanatory texts on larger screens.

plurals
  1. POGUI not appearing
    text
    copied!<p>I have a Main class that has a public static void main(String[] args) {}. I also have a class called appGUI. I have been trying to get the GUI to load when i run the Main class, but nothing occurs, not even any errors... :(</p> <p>Here is the Main class:</p> <pre><code> public class Main { /** * @param args */ public static void main(String[] args) throws Exception { appGUI gui = new appGUI(); } } </code></pre> <p>And here is the appGUI class:</p> <pre><code>import java.awt.*; import java.awt.event.*; import javax.swing.*; /* * Created by JFormDesigner on Wed Apr 03 19:24:35 BST 2013 */ /** * @author Hrach Ghapantsyan */ public class appGUI extends JFrame { public appGUI() { initComponents(); } private void loginButtonActionPerformed(ActionEvent e) { // TODO add your code here } private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Hrach Ghapantsyan loginPasswordField = new JPasswordField(); loginUsernameField = new JTextField(); usernameLabel = new JLabel(); passwordLabel = new JLabel(); loginButton = new JButton(); titleLabel = new JLabel(); //======== this ======== setTitle("Experimental X | Administrator Login"); Container contentPane = getContentPane(); contentPane.setLayout(null); contentPane.add(loginPasswordField); loginPasswordField.setBounds(80, 65, 100, loginPasswordField.getPreferredSize().height); contentPane.add(loginUsernameField); loginUsernameField.setBounds(80, 35, 100, loginUsernameField.getPreferredSize().height); //---- usernameLabel ---- usernameLabel.setText("Username:"); contentPane.add(usernameLabel); usernameLabel.setBounds(20, 40, 55, usernameLabel.getPreferredSize().height); //---- passwordLabel ---- passwordLabel.setText("Password:"); contentPane.add(passwordLabel); passwordLabel.setBounds(20, 70, 55, passwordLabel.getPreferredSize().height); //---- loginButton ---- loginButton.setText("Login"); loginButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { loginButtonActionPerformed(e); } }); contentPane.add(loginButton); loginButton.setBounds(80, 95, 100, loginButton.getPreferredSize().height); //---- titleLabel ---- titleLabel.setText("Experimental X | Administrator Login"); contentPane.add(titleLabel); titleLabel.setBounds(45, 10, 190, titleLabel.getPreferredSize().height); { // compute preferred size Dimension preferredSize = new Dimension(); for(int i = 0; i &lt; contentPane.getComponentCount(); i++) { Rectangle bounds = contentPane.getComponent(i).getBounds(); preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width); preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height); } Insets insets = contentPane.getInsets(); preferredSize.width += insets.right; preferredSize.height += insets.bottom; contentPane.setMinimumSize(preferredSize); contentPane.setPreferredSize(preferredSize); } setSize(270, 170); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables // Generated using JFormDesigner Evaluation license - Hrach Ghapantsyan private JPasswordField loginPasswordField; private JTextField loginUsernameField; private JLabel usernameLabel; private JLabel passwordLabel; private JButton loginButton; private JLabel titleLabel; // JFormDesigner - End of variables declaration //GEN-END:variables } </code></pre> <p>I have tried running the main class on Eclipse and netbeans, but it runs and then stops after a few seconds. I do not get any errors. Do any of you here have any suggestions? Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload