Designer - switching to Design view opens a new Window

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Designer - switching to Design view opens a new Window

Postby sommermartin » Wed Nov 14, 2007 1:04 pm

Hi All,

Every time I switch from source to design view a new Window is created on my desktop. I cannot get rid of them unless I close Eclipse. The windows are blank. When switching to any of them (alt + Tab) , Windows shows the Java icon (a hot cup of coffee). When closing any of them using Alt+f4, Eclipse is terminated.

I am using Eclipse 3.3.1.1
Java 1.5_05
Designger 6.5.0

any ideas?

thank you,

Martin
sommermartin
 
Posts: 8
Joined: Wed Oct 03, 2007 12:23 pm

Re: Designer - switching to Design view opens a new Window

Postby Eric Clayberg » Wed Nov 14, 2007 2:20 pm

sommermartin wrote:Every time I switch from source to design view a new Window is created on my desktop. I cannot get rid of them unless I close Eclipse. The windows are blank. When switching to any of them (alt + Tab) , Windows shows the Java icon (a hot cup of coffee). When closing any of them using Alt+f4, Eclipse is terminated. any ideas?

Just to be clear, every time you switch you get a new one, so that multiple windows build up over time?

That sounds like something being triggerd by the window we are parsing. Can you send an example that triggers this?
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

some

Postby sommermartin » Thu Nov 15, 2007 4:14 pm

Eric,

thank you very much!

I am going to send two screens, here goes one - apologies for the length.

I think that you'r right it has to do with the static main. Hum hum, I wonder how can I get around it.

thank you,

Martin
Code: Select all
package com.abc.ereporting.reports.asr;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;

import com.jgoodies.forms.factories.FormFactory;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.RowSpec;
import com.ultramain.ereporting.components.buttons.ABCTButtonMenu;
import com.ultramain.ereporting.components.buttons.ABCTButtonNext;
import com.ultramain.ereporting.components.buttons.ABCTCommandButton;
import com.ultramain.ereporting.components.containers.ABCTBaseFrame;
import com.ultramain.ereporting.components.containers.ABCTBasePanel;
import com.ultramain.ereporting.components.controls.ABCTCheckBox;
import com.ultramain.ereporting.components.controls.ABCTLabel;
import com.ultramain.ereporting.components.controls.ABCTRadioButton;

public class Page1 extends ABCTBasePanel {

    private final ABCTLabel pleaseFillTickLabel;
    private final ABCTLabel asrMustBeLabel;
    private final ABCTRadioButton goAroundRadioButton_1;
    private final ABCTRadioButton goAroundRadioButton;
    private final ABCTRadioButton landingRadioButton;
    private final ABCTButtonNext buttonNext;
    private final ABCTButtonMenu buttonMenu;
    private final ABCTCommandButton unsafeSituationOrCommandButton;
    private final ABCTCommandButton otherIncidentCommandButton;
    private final ABCTCommandButton birdStrikeCommandButton;
    private final ABCTCommandButton paxBehaviourCommandButton;
    private final ABCTCommandButton wakeTurbulanceCommandButton;
    private final ABCTCommandButton gwpsCommandButton;
    private final ABCTCommandButton tcasCommandButton;
    private final ABCTCommandButton atcCommandButton;
    private final ABCTCommandButton airproxCommandButton;
    private final ABCTLabel typeOfEventLabel;

    private final ABCTCheckBox otherIncidentCheckBox;

    private final ABCTCheckBox unsaveSitInjuryCheckBox;

    private final ABCTCheckBox birdStrikeCheckBox;

    private final ABCTCheckBox paxBehaviourCheckBox;

    private final ABCTCheckBox wakeTurbCheckBox;

    private final ABCTCheckBox gpwsCheckBox;

    private final ABCTCheckBox tcasCheckBox_1;

    private final ABCTCheckBox tcasCheckBox;

    private final ABCTCheckBox airproxCheckBox;

    private final ABCTLabel flightPhaseLabel;

    private final ButtonGroup buttonGroup = new ButtonGroup();

    private final ABCTRadioButton approachLandingOrRadioButton;

    private final ABCTRadioButton descentOrHoldingRadioButton;

    private final ABCTRadioButton cruiseCruiseCimbRadioButton;

    private final ABCTRadioButton initialClimbRadioButton;

    private final ABCTRadioButton takeOffRadioButton;

    private final ABCTRadioButton taxiRadioButton;

    private final ABCTRadioButton parkedRadioButton;

    private ABCTCheckBox checkBox;

    private ABCTRadioButton radioButton;

    private final ABCTLabel asrLabel;

    private final JPanel panel;

    public static void main(String args[]) {

        try {

            UIManager.setLookAndFeel("com.ultramain.efb.plaf.boeing.BoeingLookAndFeel");

            ABCTBaseFrame frame = new ABCTBaseFrame();
            Page1 page1 = new Page1();
            frame.setContentPane(page1);

        }
        catch(Exception e) {
            e.printStackTrace();
        }
    }

    public Page1() {
        super();
        setName("pepe");
        setPreferredSize(ABCTBasePanel.getPreferredSizeX());

        setBackground(Color.BLACK);
        setFont(new Font("Arial", Font.PLAIN, 16));
        setFocusCycleRoot(true);
        final FormLayout formLayout = new FormLayout(
                "left:1dlu, 1dlu, left:1dlu, 1dlu:grow(1.0), left:1dlu, 44dlu, left:1dlu",
                "top:1dlu, 37dlu, default:grow(1.0), default:grow(1.0), default:grow(1.0), default:grow(1.0), default:grow(1.0), default:grow(1.0), default:grow(1.0), default:grow(1.0), default:grow(1.0), default:grow(1.0), default:grow(1.0), default:grow(1.0), default:grow(1.0), default:grow(1.0), default:grow(1.0), default:grow(1.0), top:1dlu");
        formLayout.setColumnGroups(new int[][] { new int[] { 1, 2, 3, 5, 7 }, new int[] { 4, 6 } });
        formLayout.setRowGroups(new int[][] { new int[] { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 } });
        setLayout(formLayout);

        panel = new JPanel();
        panel.setFont(new Font("Arial", Font.PLAIN, 14));

        final FormLayout formLayout_1 = new FormLayout(new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, new ColumnSpec("22dlu"),
                new ColumnSpec("28dlu"), new ColumnSpec("2dlu"), new ColumnSpec("28dlu"), new ColumnSpec("16dlu"),
                new ColumnSpec("16dlu"), new ColumnSpec("16dlu"), new ColumnSpec("16dlu"), new ColumnSpec("16dlu"),
                new ColumnSpec("16dlu"), new ColumnSpec("60dlu") }, new RowSpec[] { new RowSpec("5dlu"), new RowSpec("20dlu"),
                new RowSpec("8dlu"), new RowSpec("5dlu"), new RowSpec("21dlu"), new RowSpec("5dlu"), new RowSpec("35dlu"),
                new RowSpec("5dlu"), new RowSpec("35dlu"), new RowSpec("5dlu"), new RowSpec("35dlu"), new RowSpec("5dlu"),
                new RowSpec("35dlu"), new RowSpec("5dlu"), new RowSpec("35dlu"), new RowSpec("5dlu"), new RowSpec("35dlu"),
                new RowSpec("5dlu"), new RowSpec("35dlu"), new RowSpec("5dlu"), new RowSpec("35dlu"), new RowSpec("5dlu"),
                new RowSpec("35dlu"), new RowSpec("5dlu"), new RowSpec("35dlu"), new RowSpec("5dlu") });
        panel.setLayout(formLayout_1);
        panel.setBorder(new TitledBorder(new LineBorder(Color.WHITE, 1, false), "", TitledBorder.DEFAULT_JUSTIFICATION,
                TitledBorder.DEFAULT_POSITION, null, Color.WHITE));
        add(panel, new CellConstraints(4, 3, 1, 16, CellConstraints.LEFT, CellConstraints.TOP));

        parkedRadioButton = new ABCTRadioButton();

        buttonGroup.add(parkedRadioButton);
        parkedRadioButton.setText("Parked");
        panel.add(parkedRadioButton, new CellConstraints(8, 7, 4, 1, CellConstraints.DEFAULT, CellConstraints.FILL));

        taxiRadioButton = new ABCTRadioButton();
        buttonGroup.add(taxiRadioButton);
        taxiRadioButton.setText("Taxi");
        panel.add(taxiRadioButton, new CellConstraints(8, 9, 4, 1, CellConstraints.FILL, CellConstraints.DEFAULT));

        takeOffRadioButton = new ABCTRadioButton();
        buttonGroup.add(takeOffRadioButton);
        takeOffRadioButton.setText("Take Off\nInitial Climb");
        panel.add(takeOffRadioButton, new CellConstraints(8, 11, 4, 1));

        initialClimbRadioButton = new ABCTRadioButton();
        buttonGroup.add(initialClimbRadioButton);

        initialClimbRadioButton.setText("Climb");
        panel.add(initialClimbRadioButton, new CellConstraints(8, 13, 4, 1));

        cruiseCruiseCimbRadioButton = new ABCTRadioButton();
        buttonGroup.add(cruiseCruiseCimbRadioButton);
        cruiseCruiseCimbRadioButton.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent e) {
            }
        });
        cruiseCruiseCimbRadioButton.setText("Cruise");
        panel.add(cruiseCruiseCimbRadioButton, new CellConstraints(8, 15, 4, 1));

        descentOrHoldingRadioButton = new ABCTRadioButton();
        buttonGroup.add(descentOrHoldingRadioButton);
        descentOrHoldingRadioButton.setText("Descent");
        panel.add(descentOrHoldingRadioButton, new CellConstraints(8, 17, 4, 1));

        approachLandingOrRadioButton = new ABCTRadioButton();

        buttonGroup.add(approachLandingOrRadioButton);
        approachLandingOrRadioButton.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent e) {
            }
        });
        approachLandingOrRadioButton.setText("Holding");
        panel.add(approachLandingOrRadioButton, new CellConstraints(8, 19, 4, 1, CellConstraints.FILL, CellConstraints.DEFAULT));

        flightPhaseLabel = new ABCTLabel();
        flightPhaseLabel.setHorizontalAlignment(SwingConstants.CENTER);
        flightPhaseLabel.setText("FLIGHT PHASE");
        panel.add(flightPhaseLabel, new CellConstraints(8, 5, 4, 1, CellConstraints.FILL, CellConstraints.BOTTOM));

        airproxCheckBox = new ABCTCheckBox();
        panel.add(airproxCheckBox, new CellConstraints(3, 7));

        tcasCheckBox = new ABCTCheckBox();
        panel.add(tcasCheckBox, new CellConstraints(3, 9));

        tcasCheckBox_1 = new ABCTCheckBox();
        panel.add(tcasCheckBox_1, new CellConstraints(3, 11));

        gpwsCheckBox = new ABCTCheckBox();
        panel.add(gpwsCheckBox, new CellConstraints(3, 13));

        wakeTurbCheckBox = new ABCTCheckBox();
        panel.add(wakeTurbCheckBox, new CellConstraints(3, 15, CellConstraints.FILL, CellConstraints.DEFAULT));

        paxBehaviourCheckBox = new ABCTCheckBox();
        panel.add(paxBehaviourCheckBox, new CellConstraints(3, 17));

        birdStrikeCheckBox = new ABCTCheckBox();
        panel.add(birdStrikeCheckBox, new CellConstraints(3, 19));

        unsaveSitInjuryCheckBox = new ABCTCheckBox();
        unsaveSitInjuryCheckBox.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent e) {
            }
        });
        panel.add(unsaveSitInjuryCheckBox, new CellConstraints(3, 21));

        otherIncidentCheckBox = new ABCTCheckBox();
        panel.add(otherIncidentCheckBox, new CellConstraints(3, 23));

        typeOfEventLabel = new ABCTLabel();
        typeOfEventLabel.setHorizontalAlignment(SwingConstants.CENTER);
        typeOfEventLabel.setText("TYPE OF EVENT");
        panel.add(typeOfEventLabel, new CellConstraints(3, 5, 4, 1, CellConstraints.FILL, CellConstraints.BOTTOM));

        airproxCommandButton = new ABCTCommandButton();
        airproxCommandButton.setHorizontalAlignment(SwingConstants.LEFT);
        airproxCommandButton.setText("AIRPROX");
        panel.add(airproxCommandButton, new CellConstraints(5, 7, 2, 1, CellConstraints.FILL, CellConstraints.FILL));

        atcCommandButton = new ABCTCommandButton();
        atcCommandButton.setHorizontalTextPosition(SwingConstants.LEFT);
        atcCommandButton.setHorizontalAlignment(SwingConstants.LEFT);
        atcCommandButton.setText("ATC");
        panel.add(atcCommandButton, new CellConstraints(5, 9, 2, 1, CellConstraints.DEFAULT, CellConstraints.FILL));

        tcasCommandButton = new ABCTCommandButton();
        tcasCommandButton.setHorizontalAlignment(SwingConstants.LEFT);
        tcasCommandButton.setHorizontalTextPosition(SwingConstants.LEFT);
        tcasCommandButton.setText("TCAS");
        panel.add(tcasCommandButton, new CellConstraints(5, 11, 2, 1, CellConstraints.FILL, CellConstraints.FILL));

        gwpsCommandButton = new ABCTCommandButton();
        gwpsCommandButton.setHorizontalAlignment(SwingConstants.LEFT);
        gwpsCommandButton.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent e) {
            }
        });
        gwpsCommandButton.setText("GWPS");
        panel.add(gwpsCommandButton, new CellConstraints(5, 13, 2, 1, CellConstraints.FILL, CellConstraints.FILL));

        wakeTurbulanceCommandButton = new ABCTCommandButton();
        wakeTurbulanceCommandButton.setHorizontalAlignment(SwingConstants.LEFT);
        wakeTurbulanceCommandButton.setText("Wake\nTurbulance");
        panel.add(wakeTurbulanceCommandButton, new CellConstraints(5, 15, 2, 1, CellConstraints.DEFAULT, CellConstraints.FILL));

        paxBehaviourCommandButton = new ABCTCommandButton();
        paxBehaviourCommandButton.setHorizontalAlignment(SwingConstants.LEFT);
        paxBehaviourCommandButton.setText("PAX\nBehaviour");
        panel.add(paxBehaviourCommandButton, new CellConstraints(5, 19, 2, 1, CellConstraints.DEFAULT, CellConstraints.FILL));

        birdStrikeCommandButton = new ABCTCommandButton();
        birdStrikeCommandButton.setHorizontalAlignment(SwingConstants.LEFT);
        birdStrikeCommandButton.setText("Bird\nStrike");
        panel.add(birdStrikeCommandButton, new CellConstraints(5, 17, 2, 1, CellConstraints.FILL, CellConstraints.FILL));

        otherIncidentCommandButton = new ABCTCommandButton();
        otherIncidentCommandButton.setText("Other\nIncident");
        otherIncidentCommandButton.setHorizontalAlignment(SwingConstants.LEFT);
        panel.add(otherIncidentCommandButton, new CellConstraints(5, 23, 2, 1, CellConstraints.DEFAULT, CellConstraints.FILL));

        unsafeSituationOrCommandButton = new ABCTCommandButton();

        unsafeSituationOrCommandButton.setHorizontalAlignment(SwingConstants.LEFT);
        unsafeSituationOrCommandButton.setText("Unsafe\n Situation or\n Injury on Board");
        panel.add(unsafeSituationOrCommandButton, new CellConstraints(5, 21, 2, 1, CellConstraints.DEFAULT, CellConstraints.TOP));

        landingRadioButton = new ABCTRadioButton();
        landingRadioButton.setText("Approach");
        panel.add(landingRadioButton, new CellConstraints(8, 21, 4, 1));

        goAroundRadioButton = new ABCTRadioButton();
        goAroundRadioButton.setText("Landing");
        panel.add(goAroundRadioButton, new CellConstraints(8, 23, 4, 1));

        goAroundRadioButton_1 = new ABCTRadioButton();
        goAroundRadioButton_1.setText("Go Around");
        panel.add(goAroundRadioButton_1, new CellConstraints(8, 25, 4, 1));

        asrMustBeLabel = new ABCTLabel();
        asrMustBeLabel.setText("ASR must be filed following a safety related event within 24 hours - sent ASR toN SPL/OK");
        panel.add(asrMustBeLabel, new CellConstraints(2, 2, 11, 1, CellConstraints.LEFT, CellConstraints.TOP));

        pleaseFillTickLabel = new ABCTLabel();
        pleaseFillTickLabel.setFont(new Font("Arial", Font.BOLD, 14));
        pleaseFillTickLabel.setHorizontalAlignment(SwingConstants.CENTER);
        pleaseFillTickLabel.setText("Please fill tick all applicable items.");
        panel.add(pleaseFillTickLabel, new CellConstraints(2, 3, 10, 1, CellConstraints.FILL, CellConstraints.DEFAULT));

        asrLabel = new ABCTLabel("EREPORTING - ASR  Page 1");
        asrLabel.setHorizontalAlignment(SwingConstants.CENTER);
        asrLabel.setFont(new Font("Arial", Font.PLAIN, 16));
        asrLabel.setHorizontalTextPosition(SwingConstants.LEFT);
        add(asrLabel, new CellConstraints(4, 2, CellConstraints.FILL, CellConstraints.FILL));

        buttonMenu = new ABCTButtonMenu();
        buttonMenu.setText("New ABCButtonMenu");
        add(buttonMenu, new CellConstraints(6, 6, CellConstraints.DEFAULT, CellConstraints.FILL));

        buttonNext = new ABCTButtonNext();
        buttonNext.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent e) {
            }
        });
        buttonNext.setText("New ABCButtonNext");
        add(buttonNext, new CellConstraints(6, 4, CellConstraints.DEFAULT, CellConstraints.FILL));
    }
}
sommermartin
 
Posts: 8
Joined: Wed Oct 03, 2007 12:23 pm

Re: Designer - switching to Design view opens a new Window

Postby Eric Clayberg » Thu Nov 15, 2007 8:44 pm

Try surrounding the main() method with code hidng tags...

Image
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest