Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-18-2007, 09:30 PM
Member
 
Join Date: Jul 2007
Posts: 35
silvia is on a distinguished road
Error: invalid method declaration; return type required
I am trying to write one with two buttons on it I want them side by side and I want one to close the application and the other one to execute my ftp code that I will later add once I finish the GUI.

Here is what I have so far and at the top where i create the buttons it keeps telling me invalid method declaration; return type required. right now I have it set up to beep once click becuase I have no idea how to close the program yet.

Code:
import java.awt.*; import javax.swing.*; import java.awt.event.*; public class ExportFrame { public class ExportFrame implements ActionListener { JButton pull; JButton close; public execute() { super(new BorderLayout()); pull = new JButton("Pull"); pull.setMnemonic('p'); pull.setPreferredSize(new Dimension(20, 15)); add(pull, BorderLayout.LEFT); pull.addActionListener(this); } public close() { super(new BorderLayout()); close = new JButton("Close"); close.setMnemonic('c'); close.setPreferredSize(new Dimension(20, 15)); add(close, BorderLayout.Right); close.addActionListener(this); } public void actionPerformed(ActionEvent e) { Toolkit.getDefaultToolkit().close(); Toolkit.getDefaultToolkit().execute(); } private static void createAndShowGUI(){ //Make sure we have nice window decorations. JFrame.setDefaultLookAndFeelDecorated(true); //Create and set up the window. JFrame frame = new JFrame("Stratis Export by Tyler Reid"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //Shows the UI frame.pack(); frame.setVisible(true); } public static void main(String[] args){ //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); } } }
Thanks
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-19-2007, 02:51 PM
Member
 
Join Date: Jul 2007
Posts: 17
sathish_2111 is on a distinguished road
you should have void return time....
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error :Invalid path, C:\Program Files\Java\j2re1.4.2_06\bin\javac.exe silvia New To Java 2 07-30-2007 09:55 AM
Error: invalid method declaration silvia New To Java 1 07-27-2007 01:10 PM
return type determines override/overload? hedefalk Advanced Java 4 07-11-2007 02:48 PM
The return type Marcus New To Java 1 07-05-2007 07:28 AM
Error : Invalid path, \bin\javac.exe -classpath Ed JCreator 2 07-03-2007 03:40 AM


All times are GMT +3. The time now is 10:53 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org