Hi,
meine fenster im wizard haben irgendwie keinen rahmen. woran kann das liegen?
lg
noise
meine fenster im wizard haben irgendwie keinen rahmen. woran kann das liegen?
lg
noise
^...
Es wäre äußerst seltsam, wenn es daran liegen würde. Da steht ja false und eben nicht true. Ich vermute es liegt daran, dass das L&F getauscht wird, nachdem die JFrame-Instanz initialisiert ist.Kommentiere mal die Zeile 189 in Main.java aus. Vielleicht hilft das.
package de.unituebingen.pinweb.overallGUI.Pages;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JLabel;
import javax.swing.JPanel;
import de.unituebingen.pinweb.Context.Context;
import de.unituebingen.pinweb.Wizard.PinWebAssistentView;
import de.unituebingen.pinweb.Wizard.WindowSuperclass;
public class Introduction extends WindowSuperclass {
private static final long serialVersionUID = 1L;
private Context context;
public Introduction(PinWebAssistentView wizard) {
super(wizard);
this.setLayout(new GridBagLayout());
addComponentInLayout(getContentPanel(),
0, 0, 1, 1,
0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0,0,0,0));
addComponentInLayout(getSplitPanel(),
0, 1, 1, 1,
1.0, 1.0, GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(0,0,0,0));
}
private JPanel getContentPanel() {
context = wizard.getContext();
JPanel ContentPanel = new JPanel();
ContentPanel.setLayout(new GridBagLayout());
JLabel welcomeLabel = new JLabel("Welcome to the "+context.getName()+"-Assistent");
welcomeLabel.setFont(new java.awt.Font("MS Sans Serif", Font.BOLD, 12));
//welcomeLabel.setHorizontalAlignment(welcomeLabel.WEST);
ContentPanel.add(welcomeLabel);
return ContentPanel;
}
private JPanel getSplitPanel() {
JPanel sub = new JPanel();
sub.setLayout(new GridBagLayout());
addComponentInContainer(sub, new JLabel("This Assistent will guide you through "),
0, 0, 1, 1,
1.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(30,0,0,0));
addComponentInContainer(sub, new JLabel("the "+context.getName()+" process."),
0, 1, 1, 1,
1.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,0,0,0));
addComponentInContainer(sub, new JLabel("You can always leave the assistent via 'cancel'."),
0, 2, 1, 1,
1.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,0,0,0));
return sub;
}
}
package de.unituebingen.pinweb.Wizard;
import java.awt.Component;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.LayoutManager;
import java.util.Enumeration;
import java.util.Vector;
import javax.swing.JComponent;
import javax.swing.JPanel;
import de.unituebingen.pinweb.Context.Context;
import de.unituebingen.pinweb.ExceptionEvent.ExceptionEvent;
import de.unituebingen.pinweb.ExceptionEvent.ExceptionEventListener;
import de.unituebingen.pinweb.ExceptionEvent.ExceptionEvent.ErrorEventType;
public class WindowSuperclass extends JPanel {
private static final long serialVersionUID = 1L;
private transient Vector<ExceptionEventListener> listeners;
public PinWebAssistentView wizard;
/**
* Default constructor
*/
public WindowSuperclass() {
super();
//FIXME
//Main.setLookAndFeel();
}
/**
* constructor supplying a LayoutManager
* @param arg0
*/
public WindowSuperclass(LayoutManager arg0) {
super(arg0);
//FIXME
//Main.setLookAndFeel();
}
/**
* constructor supplying a LayoutManager
* @param arg0
*/
public WindowSuperclass(PinWebAssistentView wizard) {
this.wizard = wizard;
}
/**
* constructor
* @param arg0
*/
public WindowSuperclass(boolean arg0) {
super(arg0);
//FIXME
//Main.setLookAndFeel();
}
/**
* constructor
* @param arg0 the LayoutManager to be used
* @param arg1
*/
public WindowSuperclass(LayoutManager arg0, boolean arg1) {
super(arg0, arg1);
//FIXME
//Main.setLookAndFeel();
}
/**
* @return the registered wizard
*/
public PinWebAssistentView getWizard(){
return wizard;
}
/**
* add a component to the layout
*/
public void addComponentInLayout(Component aComp, int gridX, int gridY,
int gridWidth, int gridHeight, double weightX, double weightY, int anchor,
int fill, Insets insets) {
GridBagConstraints theConstraints = new GridBagConstraints(gridX, gridY, gridWidth, gridHeight, weightX,
weightY, anchor, fill, insets, 0, 0);
add(aComp, theConstraints);
}
/**
* add a component to the container
*/
public void addComponentInContainer(JComponent aPanel, Component aComp,
int gridX, int gridY, int gridWidth, int gridHeight, double weightX,
double weightY, int anchor, int fill, Insets insets) {
GridBagConstraints theConstraints = new GridBagConstraints(gridX, gridY, gridWidth, gridHeight, weightX,
weightY, anchor, fill, insets, 0, 0);
aPanel.add(aComp, theConstraints);
}
/** Register a listener for ExceptionEvents */
synchronized public void addExceptionListener(ExceptionEventListener l) {
if (listeners == null)
listeners = new Vector<ExceptionEventListener>();
listeners.addElement(l);
}
/** Remove a listener for ExceptionEvents */
synchronized public void removeExceptionListener(ExceptionEventListener l) {
if (listeners == null)
listeners = new Vector<ExceptionEventListener>();
listeners.removeElement(l);
}
/** Fire a ExceptionEvent to all registered listeners */
@SuppressWarnings("unchecked")
public void fireEventOcured(ErrorEventType type, String mess) {
/** if we have no listeners, do nothing... */
if (listeners != null && !listeners.isEmpty()) {
/** create the event object to send */
ExceptionEvent event =
new ExceptionEvent(this, type, mess);
/**
* make a copy of the listener list in case
* anyone adds/removes listeners
*/
Vector<ExceptionEventListener> targets;
synchronized (this) {
targets = (Vector<ExceptionEventListener>) listeners.clone();
}
/**
* walk through the listener list and
* call the exceptionRisen method in each
*/
Enumeration<ExceptionEventListener> e = targets.elements();
while (e.hasMoreElements()) {
ExceptionEventListener l = e.nextElement();
l.exceptionRisen(event);
}
}
}
}