I have a string in one frame named uname.
uname = usrNameTxt.getText();
char[] pword = pwordTxt.getPassword();
String password = new String(pword);
and pointed that to the next frame by
this.dispose();
new SectionsFclty(uname).setVisible(true);
and in my another one (shown below) frame want the String uname...
public SectionsFclty() {
initComponents();
}
public SectionsFclty(String uname) {
initComponents();
jLabelUsername.setText(uname);
}
But in my second frame (SectionsFclty.java) error comes in
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jLabelUsername = new javax.swing.JLabel();..............
} // shows an error now
following error
error: illegal start of expression
private void initComponents() {
new SectionsFclty().setVisible(true);
required: String found: no arguments reason: actual and formal argument lists differ in length Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.