Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

nuala finnegan

Greenhorn
+ Follow
since Jun 15, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by nuala finnegan

oh yeah (I'm being dim!)... thanks very much!!!
8 years ago
Hi Paul,

Thanks very much for responding... Sorry the request is a bit crytic... I want the application to work like word.. So a user can open a file edit it and save it..
Or they can create a new file from scratch... If they edit an existing file i want them to be able to just hit save and I can do like you said to save the file name etc..

However, how do I prevent the dialog box from popping up? Like in for eg word you can just hit the save icon etc and nothing pops up...
This is my code, quite basic!!!

Thanks

Nuala

int returnVal1 = chooser.showSaveDialog(this);

if(returnVal1 == JFileChooser.APPROVE_OPTION) {

chooser.getSelectedFile().getPath());
8 years ago
Hi,

I was wondering if anyone can help. I have an application that has a text field I want to use Jfilechooser to save or save As the data.

If the file already exisits i want the end user to be able to hit save without the dialog box popping up asking for a file name folder etc, like it would in MS Word etc..

Is this possible?

I'd really appreciate any help

Thanks

Nuala
8 years ago
Hi Both

Thanks very much for your replies.... it works now. much appreciated!

Nuala
8 years ago
Hi,

I am new to Java and this forum so apologies if this is a very basic/stupid question!

I have a static method which reads in an external file. The external file contains 2 string which go on to populate instance variables...
As in, I create an instance of the class from a static class.

The instance I create is called DS1. How do I use DS1 in a separate test file to access other non-static methods..

I hope that makes sense! In other words if a static method can create an instance of a class how can that instance be accessed?


Any advise would be much appreciated!

Thanks,

nuala
8 years ago