Re: Invalid method declaration; return type required error

Since your class is called Transfer3, the constructor must also be called Transfer3(), otherwise it is not recognized by the compiler as the constructor and requires a return type.

that fixed it but now i am getting more errors when i click submit button:
"Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at Transfer.actionPerformed(Transfer.java:111)
at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:18
49)
at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.jav
a:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel
.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:258
)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonL
istener.java:234)
at java.awt.Component.processMouseEvent(Component.jav a:5488)
at javax.swing.JComponent.processMouseEvent(JComponen t.java:3093)
at java.awt.Component.processEvent(Component.java:525 3)
at java.awt.Container.processEvent(Container.java:196 6)
at java.awt.Component.dispatchEventImpl(Component.jav a:3955)
at java.awt.Container.dispatchEventImpl(Container.jav a:2024)
at java.awt.Component.dispatchEvent(Component.java:38 03)
at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4212
)
at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:3892)

at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:3822)
at java.awt.Container.dispatchEventImpl(Container.jav a:2010)
at java.awt.window.dispatchEventImpl(window.java:1766 )
at java.awt.Component.dispatchEvent(Component.java:38 03)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 463)
at java.awt.EventDispatchThread.pumpOneEventForHierar chy(EventDispatchTh
read.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThre
ad.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:157)

at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:149)