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 06-16-2008, 09:22 AM
Member
 
Join Date: Jun 2008
Posts: 7
Bays is on a distinguished road
Please help a noob :)
I am currently working on a lab for a java class i am in, and I am supposed to make a basic GUI with that will have text boxes, radio buttons, and combo boxes that are used to accept and calculate data on the click of a button.

My current problem is trying to take the input of the combobox when the calculate volume button is clicked.

Code:
import java.awt.*; import javax.swing.*; import java.awt.event.*; public class getWetPools extends JFrame { private static final int WIDTH = 350; private static final int HEIGHT = 400; private JLabel PlengthL, PwidthL, PdepthL, Pmodel, Plft, Pwft, Pdft; private JTextField PlengthTF, PwidthTF, PdepthTF, PvolumeTF; private JButton PcalculateBtn, PexitBtn; //Handlers private PcalcBtnHandler PcbHandler; private PexitBtnHandler PebHandler; public getWetPools() { //-----Pool Tab------------------------------------------------------------------------ Pmodel = new JLabel("Select Pool Model:"); PlengthL = new JLabel("Enter the Pool's Length:"); PwidthL = new JLabel("Enter the Pool's Width:"); PdepthL = new JLabel("Enter the Pool's Depth:"); Plft = new JLabel("ft."); Pwft = new JLabel("ft."); Pdft = new JLabel("ft."); PlengthTF = new JTextField(10); PwidthTF = new JTextField(10); PdepthTF = new JTextField(10); PvolumeTF = new JTextField(25); PvolumeTF.setEditable(false); String [] models = { "RX-45-O73", "RX34-O67", "QuickSet-347", "QuickSet-547" }; JComboBox PmodelSelect = new JComboBox(models); PmodelSelect.setEditable(false); PcalculateBtn = new JButton("Calculate Volume"); PcbHandler = new PcalcBtnHandler(); PcalculateBtn.addActionListener(PcbHandler); PexitBtn = new JButton("Exit Program"); PebHandler = new PexitBtnHandler(); PexitBtn.addActionListener(PebHandler); JFrame frame = new JFrame("Get Wet Pools & Spas"); JTabbedPane tabby = new JTabbedPane( ); JPanel pool = new JPanel( ); pool.add(Pmodel); pool.add(PmodelSelect); pool.add(PlengthL); pool.add(PlengthTF); pool.add(Plft); pool.add(PwidthL); pool.add(PwidthTF); pool.add(Pwft); pool.add(PdepthL); pool.add(PdepthTF); pool.add(Pdft); pool.add(PcalculateBtn); pool.add(PexitBtn); pool.add(PvolumeTF); PcalculateBtn.setMnemonic('C'); PexitBtn.setMnemonic('x'); tabby.addTab("Pools", pool); frame.getContentPane( ).add(tabby); frame.setSize(WIDTH, HEIGHT); frame.setVisible(true); frame.setDefaultCloseOperation(EXIT_ON_CLOSE); } private class PcalcBtnHandler implements ActionListener { public void actionPerformed(ActionEvent e) { double Pwidth, Plength, Pdepth, Pvolume; Plength = Double.parseDouble(PlengthTF.getText()); Pwidth = Double.parseDouble(PwidthTF.getText()); Pdepth = Double.parseDouble(PdepthTF.getText()); Pvolume = Plength * Pwidth * Pdepth; PvolumeTF.setText("Model's volume is: " + Pvolume); } } public class PexitBtnHandler implements ActionListener { public void actionPerformed(ActionEvent e) { System.exit(0); } } public static void main(String[] args) { getWetPools getWet = new getWetPools(); } }
I would like for the output to contain the model also,for example...

"Model RX34-O67's volume is 7392.00"

To anyone that has a solution for me thanks a million.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-16-2008, 09:26 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,042
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
You mean that want to format the output in a specific way?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
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.
(Close on September 4, 2008)

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
  #3 (permalink)  
Old 06-16-2008, 09:36 AM
Member
 
Join Date: Jun 2008
Posts: 7
Bays is on a distinguished road
No, I can do the formatting, I just dont kno how to make the JComboBox do anything but look pritty. When the PcalculateBtn is pushed i need it to read and display the model that was selected from the combobox, Im not sure how to make it check to see witch item was selected and how to set it to a varible for output.

Edit: I will try to explain it like this.

In this method the action for the PcalculateBtn JButton is defined, and it sets the value of soem varibles to the text that was typed into the TextFields. And what i need is for it to also do the same thing with the item that was selected in the JComboBox.

Code:
private class PcalcBtnHandler implements ActionListener { public void actionPerformed(ActionEvent e) { double Pwidth, Plength, Pdepth, Pvolume; Plength = Double.parseDouble(PlengthTF.getText()); Pwidth = Double.parseDouble(PwidthTF.getText()); Pdepth = Double.parseDouble(PdepthTF.getText()); Pvolume = Plength * Pwidth * Pdepth; PvolumeTF.setText("Model's volume is: " + Pvolume); } }

Last edited by Bays : 06-16-2008 at 09:47 AM.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 06-16-2008, 09:46 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,042
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
First of all define the JComboBox in class level. If not it's wired to use in the result text box you used.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
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.
(Close on September 4, 2008)

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
  #5 (permalink)  
Old 06-16-2008, 09:49 AM
Member
 
Join Date: Jun 2008
Posts: 7
Bays is on a distinguished road
Ok. And I did an edit to help better explain my problem.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 06-16-2008, 10:32 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,042
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
This may you looking,

Code:
import java.awt.*; import javax.swing.*; import java.awt.event.*; public class getWetPools extends JFrame { private static final int WIDTH = 350; private static final int HEIGHT = 400; private JLabel PlengthL, PwidthL, PdepthL, Pmodel, Plft, Pwft, Pdft; private JTextField PlengthTF, PwidthTF, PdepthTF, PvolumeTF; private JButton PcalculateBtn, PexitBtn; private JComboBox PmodelSelect; //Handlers private PcalcBtnHandler PcbHandler; private PexitBtnHandler PebHandler; public getWetPools() { //-----Pool Tab------------------------------------------------------------------------ Pmodel = new JLabel("Select Pool Model:"); PlengthL = new JLabel("Enter the Pool's Length:"); PwidthL = new JLabel("Enter the Pool's Width:"); PdepthL = new JLabel("Enter the Pool's Depth:"); Plft = new JLabel("ft."); Pwft = new JLabel("ft."); Pdft = new JLabel("ft."); PlengthTF = new JTextField(10); PwidthTF = new JTextField(10); PdepthTF = new JTextField(10); PvolumeTF = new JTextField(25); PvolumeTF.setEditable(false); String [] models = { "RX-45-O73", "RX34-O67", "QuickSet-347", "QuickSet-547" }; PmodelSelect = new JComboBox(models); PmodelSelect.setEditable(false); PcalculateBtn = new JButton("Calculate Volume"); PcbHandler = new PcalcBtnHandler(); PcalculateBtn.addActionListener(PcbHandler); PexitBtn = new JButton("Exit Program"); PebHandler = new PexitBtnHandler(); PexitBtn.addActionListener(PebHandler); JFrame frame = new JFrame("Get Wet Pools & Spas"); JTabbedPane tabby = new JTabbedPane( ); JPanel pool = new JPanel( ); pool.add(Pmodel); pool.add(PmodelSelect); pool.add(PlengthL); pool.add(PlengthTF); pool.add(Plft); pool.add(PwidthL); pool.add(PwidthTF); pool.add(Pwft); pool.add(PdepthL); pool.add(PdepthTF); pool.add(Pdft); pool.add(PcalculateBtn); pool.add(PexitBtn); pool.add(PvolumeTF); PcalculateBtn.setMnemonic('C'); PexitBtn.setMnemonic('x'); tabby.addTab("Pools", pool); frame.getContentPane( ).add(tabby); frame.setSize(WIDTH, HEIGHT); frame.setVisible(true); frame.setDefaultCloseOperation(EXIT_ON_CLOSE); } private class PcalcBtnHandler implements ActionListener { public void actionPerformed(ActionEvent e) { double Pwidth, Plength, Pdepth, Pvolume; Plength = Double.parseDouble(PlengthTF.getText()); Pwidth = Double.parseDouble(PwidthTF.getText()); Pdepth = Double.parseDouble(PdepthTF.getText()); Pvolume = Plength * Pwidth * Pdepth; PvolumeTF.setText(PmodelSelect.getSelectedItem().toString() + "Model's volume is: " + Pvolume); } } public class PexitBtnHandler implements ActionListener { public void actionPerformed(ActionEvent e) { System.exit(0); } } public static void main(String[] args) { getWetPools getWet = new getWetPools(); } }
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
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.
(Close on September 4, 2008)

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
  #7 (permalink)  
Old 06-16-2008, 10:52 AM
Member
 
Join Date: Jun 2008
Posts: 7
Bays is on a distinguished road
OMG your a life saver, that is exactly correct. Thanks a million.

I have another Questions, and will let you take a shot at it.

I am also required to make the output be added to a outside file, and then I will have to code a tab that will read the file. Can you kinda direct me in a path that explains how to use read and write features in java. Or posibly just show me how i would write this output to a file, and i will be able to figure out the read.

Thanks again. +rep
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 06-16-2008, 11:15 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,042
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Actually to write a file, you need to have a buffered the stream, basically you have to use a BufferedWriter. Try and see.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
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.
(Close on September 4, 2008)

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
  #9 (permalink)  
Old 06-16-2008, 12:44 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 524
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
BufferedWriter and an example.

Hope that helps,
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully
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
  #10 (permalink)  
Old 06-16-2008, 04:27 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,042
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
See you got a nice example here. Better to test it carefully first.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
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.
(Close on September 4, 2008)

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
  #11 (permalink)  
Old 06-16-2008, 09:15 PM
Member
 
Join Date: Jun 2008
Posts: 7
Bays is on a distinguished road
ok, this is working, however each time the program is ran, or each time the button is pusshed it clears the file and writes the line. I dont want it to clear the file, i want it to write the information on a new line. Here is what i got right now.

Code:
private class PcalcBtnHandler implements ActionListener { public void actionPerformed(ActionEvent e) { double Pwidth, Plength, Pdepth, Pvolume; String volumeOutput; Plength = Double.parseDouble(PlengthTF.getText()); Pwidth = Double.parseDouble(PwidthTF.getText()); Pdepth = Double.parseDouble(PdepthTF.getText()); Pvolume = Plength * Pwidth * Pdepth; volumeOutput = ("Model " + PmodelSelect.getSelectedItem().toString() + "'s volume is: " + Pvolume); PvolumeTF.setText(volumeOutput); BufferedWriter bufferedWriter = null; try { //Construct the BufferedWriter object bufferedWriter = new BufferedWriter(new FileWriter("info.dat")); //Start writing to the output stream bufferedWriter.write(volumeOutput); bufferedWriter.newLine(); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } finally { //Close the BufferedWriter try { if (bufferedWriter != null) { bufferedWriter.flush(); bufferedWriter.close(); } } catch (IOException ex) { ex.printStackTrace(); } } }
Bookmark Post in Technorati
Reply With Quote
  #12 (permalink)  
Old 06-17-2008, 04:37 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,042
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Lots of errors in this class.

1. private access modifier is not allowed.

2. If this is the full code of the class, PlengthTF, PwidthTF and few other variables are not defined.

3. Required packages are not imported.

Here is a much simpler example. See what happened there. Basically what you have to do is, append data to the file.

Code:
public static void main(String[] args) { try { FileWriter fw = new FileWriter("files/AppendData.txt", true); BufferedWriter bw = new BufferedWriter(fw); bw.write("Java"); bw.close(); } catch(Exception e) { System.out.println(e.getLocalizedMessage()); } }
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
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.
(Close on September 4, 2008)

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
  #13 (permalink)  
Old 06-17-2008, 06:10 AM
Member
 
Join Date: Jun 2008
Posts: 7
Bays is on a distinguished road
no
no that was not the full code. Here it is so far.

Code:
import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.FileNotFoundException; public class getWetPools extends JFrame { private static final int WIDTH = 350; private static final int HEIGHT = 400; private JLabel PlengthL, PwidthL, PdepthL, Pmodel, Plft, Pwft, Pdft, pInfo, sShape, sWidthL, sLengthL, sDepthL, sVolumeL, Slft, Swft, Sdft; private JTextField PlengthTF, PwidthTF, PdepthTF, PvolumeTF, sLengthTF, sWidthTF, sDepthTF, sVolumeTF; private JTextArea pMInfo; private JButton PcalculateBtn, PexitBtn, sCalcBtn, sExitBtn; String modelInfo; String [] models = { "RX-45-O73", "RX34-O67", "QuickSet-347", "QuickSet-547" }; JComboBox PmodelSelect = new JComboBox(models); //Handlers private PcalcBtnHandler PcbHandler; private PexitBtnHandler PebHandler; public getWetPools() { //-----Pool Define-------------------------------------------------------------------- Pmodel = new JLabel("Select Pool Model:"); PlengthL = new JLabel("Enter the Pool's Length:"); PwidthL = new JLabel("Enter the Pool's Width:"); PdepthL = new JLabel("Enter the Pool's Depth:"); Plft = new JLabel("ft."); Pwft = new JLabel("ft."); Pdft = new JLabel("ft."); PlengthTF = new JTextField(10); PwidthTF = new JTextField(10); PdepthTF = new JTextField(10); PvolumeTF = new JTextField(25); PvolumeTF.setEditable(false); PmodelSelect.setEditable(true); PcalculateBtn = new JButton("Calculate Volume"); PcbHandler = new PcalcBtnHandler(); PcalculateBtn.addActionListener(PcbHandler); PexitBtn = new JButton("Exit Program"); PebHandler = new PexitBtnHandler(); PexitBtn.addActionListener(PebHandler); //-----pInfo Define-------------------------------------------------------------------- pInfo = new JLabel("Current Model Information:"); pMInfo = new JTextArea(6, 25); pMInfo.setEditable(false); //-----Spas Define--------------------------------------------------------------------- sShape = new JLabel("Select Spa Shape:"); sLengthL = new JLabel("Enter Spa's Length:"); sWidthL = new JLabel("Enter Spa's Width:"); sDepthL = new JLabel("Enter Spa's Depth:"); Slft = new JLabel("ft."); Swft = new JLabel("ft."); Sdft = new JLabel("ft."); sLengthTF = new JTextField(10); sWidthTF = new JTextField(10); sDepthTF = new JTextField(10); sVolumeTF = new JTextField(25); //-----Tabs Created-------------------------------------------------------------------- JFrame frame = new JFrame("Get Wet Pools & Spas"); JTabbedPane tabby = new JTabbedPane( ); //-----Pool Tab------------------------------------------------------------------------ JPanel pool = new JPanel( ); pool.add(Pmodel); pool.add(PmodelSelect); pool.add(PlengthL); pool.add(PlengthTF); pool.add(Plft); pool.add(PwidthL); pool.add(PwidthTF); pool.add(Pwft); pool.add(PdepthL); pool.add(PdepthTF); pool.add(Pdft); pool.add(PcalculateBtn); pool.add(PexitBtn); pool.add(PvolumeTF); PcalculateBtn.setMnemonic(KeyEvent.VK_C); PexitBtn.setMnemonic(KeyEvent.VK_X); //-----Pool Info tab--------------------------------------------------------------------- JPanel poolInfo = new JPanel( ); poolInfo.add(pInfo); poolInfo.add(pMInfo); try { BufferedReader br = new BufferedReader(new FileReader("models.txt")); while ((modelInfo = br.readLine()) != null) { // while loop begins here pMInfo.setText(modelInfo); } // end while } // end try catch (IOException ex) { System.err.println("Error: " + ex); } //-----Pool Info tab--------------------------------------------------------------------- JPanel spas = new JPanel( ); spas.add(sShape); //--------------------------------------------------------------------------------------- tabby.addTab("Pools", pool); tabby.addTab("Pool Info", poolInfo); tabby.addTab("Spas", spas); frame.getContentPane( ).add(tabby); frame.setSize(WIDTH, HEIGHT); frame.setVisible(true); frame.setDefaultCloseOperation(EXIT_ON_CLOSE); } //-----Pool Buttons-------------------------------------------------------------------------- private class PcalcBtnHandler implements ActionListener { public void actionPerformed(ActionEvent e) { double Pwidth, Plength, Pdepth, Pvolume; String volumeOutput; Plength = Double.parseDouble(PlengthTF.getText()); Pwidth = Double.parseDouble(PwidthTF.getText()); Pdepth = Double.parseDouble(PdepthTF.getText()); Pvolume = Plength * Pwidth * Pdepth; volumeOutput = ("Model " + PmodelSelect.getSelectedItem().toString() + "'s volume is: " + Pvolume); PvolumeTF.setText(volumeOutput); BufferedWriter bufferedWriter = null; try { //Construct the BufferedWriter object bufferedWriter = new BufferedWriter(new FileWriter("models.txt")); //Start output stream bufferedWriter.write(volumeOutput); bufferedWriter.newLine(); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } finally { //Close the BufferedWriter try { if (bufferedWriter != null) { bufferedWriter.flush(); bufferedWriter.close(); } } catch (IOException ex) { ex.printStackTrace(); } } } } public class PexitBtnHandler implements ActionListener { public void actionPerformed(ActionEvent e) { System.exit(0); } } public static void main(String[] args) { getWetPools getWet = new getWetPools(); } }
Bookmark Post in Technorati
Reply With Quote
  #14 (permalink)  
Old 06-17-2008, 06:34 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,042
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Did you try this with what I pointed in my code?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
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.
(Close on September 4, 2008)

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
  #15 (permalink)  
Old 06-17-2008, 06:59 AM
Member
 
Join Date: Jun 2008
Posts: 7
Bays is on a distinguished road
Yes that worked, seems like the bufferedWriter.newLine(); was what was causeing it....

How would i make it linebreak and print to a new line everytime it writes something?
Bookmark Post in Technorati
Reply With Quote
  #16 (permalink)  
Old 06-17-2008, 07:11 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,042
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Concatenate a new-line character at the end of the string you want to write to the file.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
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.
(Close on September 4, 2008)

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
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
Noob question- easy mattonitto New To Java 7 06-13-2008 01:26 AM
[noob]Problem with TOS .bat