Click here to Skip to main content
15,895,142 members

JFormDesigner design it won't display?

Malasuerte94 asked:

Open original thread
Java
import java.awt.*;
import javax.swing.*;
import javax.swing.GroupLayout;

/**
 * @author Ene Ion
 */
public class launcher extends JFrame {

        public launcher() {
        initComponents();
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        // Generated using JFormDesigner Evaluation license - Ene Ion
        mbmlauncherfata = new JFrame();
        textField1 = new JTextField();
        checkBox1 = new JCheckBox();
        label1 = new JLabel();
        comboBox1 = new JComboBox();
        label2 = new JLabel();
        comboBox2 = new JComboBox();
        button1 = new JButton();
        button2 = new JButton();
        button3 = new JButton();
        progressBar1 = new JProgressBar();
        label3 = new JLabel();
        label4 = new JLabel();
        button4 = new JButton();
        button5 = new JButton();
        label5 = new JLabel();
        button6 = new JButton();

        //======== mbmlauncherfata ========
        {
            mbmlauncherfata.setTitle("MBMLauncher");
            mbmlauncherfata.setIconImage(new ImageIcon("E:\\Chituri\\MBMLauncherJava\\src\\resursele\\icon_4_64x64x32.png").getImage());
            mbmlauncherfata.setResizable(false);
            Container mbmlauncherfataContentPane = mbmlauncherfata.getContentPane();

            //---- textField1 ----
            textField1.setText("Username");
            textField1.setForeground(new Color(153, 0, 0));

            //---- checkBox1 ----
            checkBox1.setText("Remember Me");

            //---- label1 ----
            label1.setText("RAM Allocated");

            //---- comboBox1 ----
            comboBox1.setModel(new DefaultComboBoxModel(new String[] {
                "256M",
                "512M",
                "1024M",
                "2G",
                "3G",
                "4G"
            }));

            //---- label2 ----
            label2.setText("to");

            //---- comboBox2 ----
            comboBox2.setModel(new DefaultComboBoxModel(new String[] {
                "512M",
                "1024M",
                "2G",
                "3G",
                "4G",
                "5G",
                "6G"
            }));

            //---- button1 ----
            button1.setText("Play");
            button1.setFont(new Font("Snap ITC", Font.BOLD, 36));
            button1.setForeground(new Color(255, 102, 0));

            //---- button2 ----
            button2.setText("Update Game");

            //---- button3 ----
            button3.setText("Update Launcher");

            //---- label3 ----
            label3.setText("Download status:");

            //---- label4 ----
            label4.setText("Nothing in download");

            //---- button4 ----
            button4.setText("Texture Packs");

            //---- button5 ----
            button5.setText(".game");

            //---- label5 ----
            label5.setText("Drag and drop your texture\npack in the box *.zip files");
            label5.setIcon(new ImageIcon("E:\\Chituri\\MBMLauncherJava\\src\\resursele\\dasdasdasd.png"));

            //---- button6 ----
            button6.setText("Made By Malasuerte94");

            GroupLayout mbmlauncherfataContentPaneLayout = new GroupLayout(mbmlauncherfataContentPane);
            mbmlauncherfataContentPane.setLayout(mbmlauncherfataContentPaneLayout);
            mbmlauncherfataContentPaneLayout.setHorizontalGroup(
                mbmlauncherfataContentPaneLayout.createParallelGroup()
                    .addGroup(mbmlauncherfataContentPaneLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(mbmlauncherfataContentPaneLayout.createParallelGroup()
                            .addComponent(progressBar1, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(button1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(mbmlauncherfataContentPaneLayout.createSequentialGroup()
                                .addComponent(button2, GroupLayout.PREFERRED_SIZE, 131, GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(button3, GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE))
                            .addGroup(mbmlauncherfataContentPaneLayout.createSequentialGroup()
                                .addComponent(button4, GroupLayout.PREFERRED_SIZE, 130, GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(button5, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(mbmlauncherfataContentPaneLayout.createSequentialGroup()
                                .addComponent(textField1, GroupLayout.PREFERRED_SIZE, 136, GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(checkBox1))
                            .addGroup(mbmlauncherfataContentPaneLayout.createSequentialGroup()
                                .addComponent(label1)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(label2)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(comboBox2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                            .addGroup(mbmlauncherfataContentPaneLayout.createSequentialGroup()
                                .addComponent(label3, GroupLayout.PREFERRED_SIZE, 96, GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(label4))
                            .addComponent(label5, GroupLayout.PREFERRED_SIZE, 270, GroupLayout.PREFERRED_SIZE)
                            .addComponent(button6, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addContainerGap())
            );
            mbmlauncherfataContentPaneLayout.setVerticalGroup(
                mbmlauncherfataContentPaneLayout.createParallelGroup()
                    .addGroup(mbmlauncherfataContentPaneLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(mbmlauncherfataContentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(checkBox1)
                            .addComponent(textField1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(mbmlauncherfataContentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(label2)
                            .addComponent(comboBox2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addComponent(label1)
                            .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(button1)
                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(mbmlauncherfataContentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(button2)
                            .addComponent(button3))
                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(progressBar1, GroupLayout.PREFERRED_SIZE, 18, GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(mbmlauncherfataContentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(label4)
                            .addComponent(label3))
                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(mbmlauncherfataContentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(button4)
                            .addComponent(button5))
                        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(label5)
                        .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(button6, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(10, Short.MAX_VALUE))
            );
            mbmlauncherfata.setSize(305, 395);
            mbmlauncherfata.setLocationRelativeTo(null);
        }
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    // Generated using JFormDesigner Evaluation license - Ene Ion
    private JFrame mbmlauncherfata;
    private JTextField textField1;
    private JCheckBox checkBox1;
    private JLabel label1;
    private JComboBox comboBox1;
    private JLabel label2;
    private JComboBox comboBox2;
    private JButton button1;
    private JButton button2;
    private JButton button3;
    private JProgressBar progressBar1;
    private JLabel label3;
    private JLabel label4;
    private JButton button4;
    private JButton button5;
    private JLabel label5;
    private JButton button6;
    // JFormDesigner - End of variables declaration  //GEN-END:variables

    public static void main(String[] args) {
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                launcher GUI = new launcher();
                GUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                GUI.setVisible(true);
            }
        });
    }



}

Result is a empty java box.. I try to fix this problem but i am beginer in java scripting, where is the problem and how i can fix it ? Tanks for helping, and recomand me please some good plugins for Eclipse.
PICTURE
Tags: Javascript, Java (Java SE, Java SE 6), JScript .NET, GUI

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900