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-09-2008, 01:55 PM
Member
 
Join Date: Jul 2008
Posts: 18
JavaLerner is on a distinguished road
Open File
Hi all

How can i open a .txt file through menu item.Plz help me
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-09-2008, 04:49 PM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: SW MO, USA
Posts: 1,480
Norm is on a distinguished road
Add a listener to the menu item and when the item is selected, the listener will be called and there you can open the file.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-10-2008, 07:19 AM
Member
 
Join Date: Jul 2008
Posts: 18
JavaLerner is on a distinguished road
Quote:
Originally Posted by Norm View Post
Add a listener to the menu item and when the item is selected, the listener will be called and there you can open the file.
Sir can you give me some code of this..
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-10-2008, 06:14 PM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: SW MO, USA
Posts: 1,480
Norm is on a distinguished road
You can probably find all you want by using a search.
Look that the API doc for the type of menu item you are using, find the addListener methods that are defined for that class and do a search for those methods. That could find you examples of how to use them.
Same for the other parts of the problem.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 07-12-2008, 07:21 PM
Member
 
Join Date: Jul 2008
Posts: 32
Engineeringserver.com is on a distinguished road
You can use the File class to open a file and the scanner class to read it. It isn't that difficult to write a simple text reader.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

<--
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Java developer
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 07-12-2008, 07:41 PM
Nicholas Jordan's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Southwest
Posts: 567
Nicholas Jordan is on a distinguished road
oversimplified place to start
Quote:
Originally Posted by Engineeringserver.com View Post
You can use the File class to open a file and the scanner class to read it. It isn't that difficult to write a simple text reader.
Java Learner,

These other two posters are heavily experienced, I did not try to get this to compile: They can help you with this:

Code:
import java.io.File;// import java.io.PrintWriter:// public class FileDemo { public static void main(String[] args) { // Simple for(int i= 0;i < args.length;i++) { File nextFile = new File(args[i]); if(nextFile.exists()) { ;// That file already exists. } else { PrintWriter printWrite = new PrintWriter(nextFile); } } }
__________________
Please provide your feedback on our
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
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
open a pdf file in linux aparna Advanced Java 4 09-28-2008 06:37 AM
how to open a file through URL katie New To Java 3 07-13-2008 03:53 AM
To open an image file such as Jpeg file using JAva Program itmani2020 Advanced Java 10 07-11-2008 10:57 AM
Is it possible to open a txt file? jason27131 New To Java 20 08-07-2007 02:24 AM
open lazlo Peter Advanced Java 2 07-04-2007 07:22 AM


All times are GMT +3. The time now is 03:07 PM.


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