Home » Archived » Visual Editor (VE) » What is nedded för VE to display a visual class?
What is nedded för VE to display a visual class? [message #94114] |
Thu, 16 June 2005 12:10 |
Eclipse User |
|
|
|
Originally posted by: lars.bergholm.sifu.se
I have a project that I have moved from Jbuilder.
I would very much want to use the VE, but the visual classes don't show up
in the design pane. I suspect thera are som rules that I have to follow.
For instance the code below doesn't work.
I would be very happy if someone could help me with this.
-------------------------------------
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class Diaom extends JDialog {
JPanel panel1 = new JPanel();
JButton Ok = new JButton();
JLabel text1 = new JLabel();
JLabel text2 = new JLabel();
JLabel text3 = new JLabel();
JLabel text4 = new JLabel();
public Diaom(JDialog frame, String title, boolean modal) {
//public Diaom(Frame frame, String title, boolean modal) {
super(frame, title, modal);
try {
jbInit();
}
catch(Exception ex) {
Diafel diafel = new Diafel(this, "Varning...", true,
"Dialogruta kunde ej öppnas!");
diafel.setLocationRelativeTo(this);
diafel.setVisible(true);
}
}
void jbInit() throws Exception {
this.setBounds(new Rectangle(290, 200));
this.setResizable(false);
panel1.setLayout(null);
panel1.setBackground(Color.white);
Ok.setMargin(new Insets(2, 2, 2, 2));
Ok.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
Ok_actionPerformed(e);
}
});
text2.setHorizontalAlignment(SwingConstants.CENTER);
getContentPane().add(panel1);
Ok.setBounds(new Rectangle(104, 132, 80, 25));
Ok.setText("OK");
text1.setForeground(Color.blue);
text1.setFont(new Font("TimesRoman", 3, 24));
text1.setBounds(new Rectangle(20, 5, 250, 40));
text1.setText("Riskbehandlingssystem");
text2.setFont(new Font("TimesRoman", 1, 14));
text2.setBounds(new Rectangle(106, 43, 83, 40));
text2.setText("(c) SIFU AB");
text3.setFont(new Font("TimesRoman", 0, 10));
text3.setBounds(new Rectangle(123, 70, 200, 40));
text3.setText("2003");
text4.setFont(new Font("TimesRoman", 1, 16));
text4.setBounds(new Rectangle(108, 90, 200, 40));
text4.setText("Version 4.01");
panel1.add(Ok, null);
panel1.add(text1, null);
panel1.add(text3, null);
panel1.add(text4, null);
panel1.add(text2, null);
}
void Ok_actionPerformed(ActionEvent e) {
this.setVisible(false);
}
}
|
|
| | | | |
Goto Forum:
Current Time: Fri Apr 26 06:10:56 GMT 2024
Powered by FUDForum. Page generated in 0.03426 seconds
|