Brian Cummins

Greenhorn
+ Follow
since Feb 24, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Brian Cummins

I am using a JOptionPane
e.g

String input = JOptionPane.showInputDialog("Enter Value")
19 years ago
Hi. I have two questions about inputboxes:

1.Is there any way of changing the title from "input"?

2. Is there any way of exiting the procedure if the cancel button is pushed(without using try catch)?

Thanks
19 years ago
Thanks very much. Bout time java started showin the paddys some respect!!!
19 years ago
Hi, I was just wondering is there any locale that uses the � with a decimal point instead of a comma.

e.g.
�20.00 instead of �20,00

This is the code i am using at the moment


Is there any locale i can use for Ireland. I've tried almost everything (IRELAND, EIRE, IRL, ROI, etc.) and I can't find it.
19 years ago
I have to convert it to a string first to display it in the textbox
19 years ago
Hi. My price value is read in from a file as a float value. I then convert this to local currency and then to String using this code:



However, my problem is when i am trying to save this value again. The value has to be saved as a Float. Is there any way of taking out the � sign so that i can convert it back to a Float.
19 years ago
Thanks for the advice. I couldnt get it to work though. I ended up using an arraylist and using the objectOutputStream (without append) to write it to the file. Its much easier that way and its easier to add, edit and delete... jus thought you'd like to know in case anyone else is having the same problems.
19 years ago
Can anyone give me an example of converting a float to currency(�).

Thanks
19 years ago
Thanks for the advice. But can you actually overwrite that object in the file after editing.
19 years ago
I was just wondering if there is any way of editing or deleting objects when they are read from a text file using the ObjectInputStream.
19 years ago
Hi I am pretty new to java and im having a problem with my program. My problem is appending objects to a file. When my program is first opened i can save books to the file and display them. However, when i exit and reopen the project i can only display objects previously added even after i save new objects to the file. i think the problem is that the ObjectoutputStream is writing a new header to the file each time it is opened. Is there any way to get past this?



objOutputBook = new FileOutputStream("Book.txt",true);
objSaveBook = new ObjectOutputStream(objOutputBook);


Book bookCurrent = new Book(txtId.getText(), txtTitle.getText(),txtAuthor.getText(),
txtPublisher.getText(),txtGenre.getText(), Float.parseFloat(txtPrice.getText()), Integer.parseInt(txtQty.getText()));

objSaveBook.writeObject(bookCurrent);
}
19 years ago