Home » Archived » Visual Editor (VE) » UnUnderstanding of a problem in a visual class
UnUnderstanding of a problem in a visual class [message #135440] |
Thu, 01 February 2007 11:14 |
Eclipse User |
|
|
|
Originally posted by: immyhumi.hotmail.com
------=_Part_216_28484389.1170328661681
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi,
I've created the following file it shows ok but can't run and object declaration is also shown as error. what is the actual problem in this that it can't run plz tell me after review it.
imran khan.
------=_Part_216_28484389.1170328661681
Content-Type: application/octet-stream; name=copypastedialog.java
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=copypastedialog.java
package Dialogs;
import Wizards.*;
import javax.swing.JPanel;
import java.awt.Frame;
import javax.swing.JDialog;
import java.awt.Dimension;
import java.awt.Color;
import javax.swing.JLabel;
import java.awt.Rectangle;
import javax.swing.ImageIcon;
import javax.swing.BorderFactory;
import java.awt.Font;
import javax.swing.JTextArea;
import javax.swing.JButton;
import java.awt.SystemColor;
public class CopyPasteDialog extends JDialog {
private static final long serialVersionUID = 1L;
private JPanel jContentPane = null;
private JLabel jLabel = null;
private JLabel jLabel1 = null;
private JTextArea jTextArea = null;
private JButton btnOK = null;
/**
* This method initializes jTextArea
*
* @return javax.swing.JTextArea
*/
private JTextArea getJTextArea() {
if (this.jTextArea == null) {
try {
this.jTextArea = new JTextArea();
this.jTextArea.setBounds(new Rectangle(14, 64, 428, 181)); // Generated
this.jTextArea.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.blue)); // Generated
} catch (java.lang.Throwable e) {
}
}
return this.jTextArea;
}
/**
* This method initializes btnOK
*
* @return javax.swing.JButton
*/
private JButton getBtnOK() {
if (this.btnOK == null) {
try {
this.btnOK = new JButton();
this.btnOK.setBounds(new Rectangle(329, 248, 59, 22)); // Generated
this.btnOK.setBackground(Color.white); // Generated
this.btnOK.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); // Generated
this.btnOK.setIcon(new ImageIcon(this.getClass().getResource("/images/ok.jpg"))); // Generated
this.btnOK.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnOkActionPerformed(evt);
}
});
this.btnOK.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseEntered(java.awt.event.MouseEvent evt) {
btnOkMouseEntered(evt);
}
public void mouseExited(java.awt.event.MouseEvent evt) {
btnOkMouseExited(evt);
}
});
} catch (java.lang.Throwable e) {
}
}
return this.btnOK;
}
private ImageClass northPanel;
/** Creates new form CopyPasteDialog */
public CopyPasteDialog(java.awt.Frame parent, boolean modal) {
super(parent, modal);
try
{
this.northPanel = new ImageClass("back/back1.jpg");
this.northPanel.setLayout(null);
this.northPanel.setBounds(0,0,728, 524);
this.northPanel.setVisible(true);
this.add(this.northPanel);
}catch(Exception e){/*handled in paintComponent()*/}
Dimension scrn = this.getToolkit().getScreenSize();
this.setBounds( (scrn.width-this.getWidth())/2, (scrn.height-this.getHeight())/2, this.getWidth(), this.getHeight() );
}
private void btnOkActionPerformed(java.awt.event.ActionEvent evt) {
setVisible(false);
}
private void btnOkMouseExited(java.awt.event.MouseEvent evt) {
btnOK.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/newImages/ok.gif ")));
}
private void btnOkMouseEntered(java.awt.event.MouseEvent evt) {
btnOK.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/newImages/ok-over.gif ")));
}
/**
* @param args
*/
public static void main(String[] args) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new CopyPasteDialog(new javax.swing.JFrame(), true).setVisible(true);
}
});
}
/**
* @param owner
*/
public CopyPasteDialog(Frame owner) {
super(owner);
this.initialize();
}
/**
* This method initializes this
*
* @return void
*/
private void initialize() {
this.setSize(467, 309);
this.setContentPane(this.getJContentPane());
}
/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private JPanel getJContentPane() {
if (this.jContentPane == null) {
this.jLabel1 = new JLabel();
this.jLabel1.setFont(new Font("Tahoma", Font.PLAIN, 12)); // Generated
this.jLabel1.setForeground(new Color(0, 153, 255)); // Generated
this.jLabel1.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); // Generated
jLabel1.setBounds(new Rectangle(137, 39, 257, 24)); // Generated
this.jLabel1.setText("Paste Text Message"); // Generated
this.jLabel = new JLabel();
this.jLabel.setIcon(new ImageIcon(this.getClass().getResource("/images/InputMessage.jpg "))); // Generated
this.jLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); // Generated
jLabel.setBounds(new Rectangle(45, 7, 142, 31)); // Generated
this.jLabel.setText(""); // Generated
this.jContentPane = new JPanel();
this.jContentPane.setLayout(null);
this.jContentPane.setBackground(SystemColor.control); // Generated
this.jContentPane.add(this.jLabel, null); // Generated
this.jContentPane.add(this.jLabel1, null); // Generated
this.jContentPane.add(this.getJTextArea(), null); // Generated
this.jContentPane.add(this.getBtnOK(), null); // Generated
jContentPane.add(jLabel, null); // Generated
jContentPane.add(jLabel1, null); // Generated
}
return this.jContentPane;
}
} // @jve:decl-index=0:visual-constraint="10,10"
------=_Part_216_28484389.1170328661681
Content-Type: application/octet-stream; name=copypastexml.java
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=copypastexml.java
package Dialogs;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Frame;
import java.awt.Rectangle;
import java.awt.SystemColor;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
public class CopyPasteXML extends JDialog {
private static final long serialVersionUID = 1L;
private JPanel jContentPane = null;
private JLabel jLabel = null;
private JLabel jLabel1 = null;
private JTextArea jTextArea = null;
private JButton btnOK = null;
/**
* @param owner
*/
public CopyPasteXML(Frame owner) {
super(owner);
this.initialize();
}
/**
* This method initializes this
*
* @return void
*/
private void initialize() {
this.setSize(487, 374);
this.setContentPane(this.getJContentPane());
}
/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private JPanel getJContentPane() {
if (this.jContentPane == null) {
this.jLabel1 = new JLabel();
this.jLabel1.setBounds(new Rectangle(90, 36, 258, 30)); // Generated
this.jLabel1.setFont(new Font("Tahoma", Font.PLAIN, 12)); // Generated
this.jLabel1.setForeground(new Color(0, 153, 255)); // Generated
this.jLabel1.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); // Generated
this.jLabel1.setText("Paste XML Message"); // Generated
this.jLabel = new JLabel();
this.jLabel.setBounds(new Rectangle(7, 2, 149, 32)); // Generated
this.jLabel.setIcon(new ImageIcon(this.getClass().getResource("/images/InputMessage.jpg "))); // Generated
this.jLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); // Generated
this.jLabel.setText(""); // Generated
this.jContentPane = new JPanel();
this.jContentPane.setLayout(null);
this.jContentPane.setBackground(SystemColor.control); // Generated
this.jContentPane.add(this.jLabel, null); // Generated
this.jContentPane.add(this.jLabel1, null); // Generated
this.jContentPane.add(this.getJTextArea(), null); // Generated
this.jContentPane.add(this.getBtnOK(), null); // Generated
}
return this.jContentPane;
}
/**
* This method initializes jTextArea
*
* @return javax.swing.JTextArea
*/
private JTextArea getJTextArea() {
if (this.jTextArea == null) {
try {
this.jTextArea = new JTextArea();
this.jTextArea.setBounds(new Rectangle(16, 75, 441, 224)); // Generated
this.jTextArea.setBorder(BorderFactory.createLineBorder(Syst emColor.activeCaption, 1)); // Generated
} catch (java.lang.Throwable e) {
// TODO: Something
}
}
return this.jTextArea;
}
/**
* This method initializes btnOK
*
* @return javax.swing.JButton
*/
private JButton getBtnOK() {
if (this.btnOK == null) {
try {
this.btnOK = new JButton();
this.btnOK.setBounds(new Rectangle(374, 304, 63, 30)); // Generated
this.btnOK.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); // Generated
this.btnOK.setIcon(new ImageIcon(this.getClass().getResource("/images/ok.jpg"))); // Generated
this.btnOK.setBackground(SystemColor.control); // Generated
this.btnOK.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
CopyPasteXML.this.btnOkActionPerformed(evt);
}
});
this.btnOK.addMouseListener(new java.awt.event.MouseAdapter() {
@Override
public void mouseEntered(java.awt.event.MouseEvent evt) {
CopyPasteXML.this.btnOkMouseEntered(evt);
}
@Override
public void mouseExited(java.awt.event.MouseEvent evt) {
CopyPasteXML.this.btnOkMouseExited(evt);
}
});
} catch (java.lang.Throwable e) {
// TODO: Something
}
}
return this.btnOK;
}
private void btnOkActionPerformed(java.awt.event.ActionEvent evt) {
this.setVisible(false);
}
private void btnOkMouseExited(java.awt.event.MouseEvent evt) {
this.btnOK.setIcon(new javax.swing.ImageIcon(this.getClass().getResource("/images/newImages/ok.gif ")));
}
private void btnOkMouseEntered(java.awt.event.MouseEvent evt) {
this.btnOK.setIcon(new javax.swing.ImageIcon(this.getClass().getResource("/images/newImages/ok-over.gif ")));
}
public static void main(String[] args) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new CopyPasteXML(new javax.swing.JFrame(), true).setVisible(true);
}
});
}
} // @jve:decl-index=0:visual-constraint="10,10"
------=_Part_216_28484389.1170328661681--
|
|
| | |
Goto Forum:
Current Time: Thu Sep 19 15:28:02 GMT 2024
Powered by FUDForum. Page generated in 0.03584 seconds
|