Search:

Type: Posts; User: JamesdTurnham

Page 1 of 2 1 2

Search: Search took 0.37 seconds.

  1. Replies
    8
    Views
    298

    Re: Event Handler For a JTextField

    Floats aren't very precise so I will probably switch the textboxes to a formatted text box and I still need to get the comboboxes active, but I got over the first hurdle without to much difficulty. ...
  2. Replies
    8
    Views
    298

    Re: Event Handler For a JTextField

    Thanks. I saw that but couldn't figure out til you pointed it out. It works now, but I still have little tweaks to do.
  3. Replies
    8
    Views
    298

    Re: Event Handler For a JTextField

    /*
    *
    *
    */

    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.text.*;
  4. Replies
    8
    Views
    298

    Re: Event Handler For a JTextField

    /*
    *
    *
    */

    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
  5. Replies
    8
    Views
    298

    Event Handler For a JTextField

    /*
    *
    *
    */

    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.text.*;
  6. Replies
    8
    Views
    508

    Re: Event Listener for ComboBox

    I've redone my code and have tried to emulate the examples from the Oracle website but I still keep getting errors. Most of them are <identifier> expected. In this case the bolded part is where I...
  7. Replies
    8
    Views
    508

    Re: Event Listener for ComboBox

    How do I tell the program in the actionPerformed method to go through each JComboBox? Also if I put the action listener in the "construction box" I get compiling errors. When I add the...
  8. Replies
    8
    Views
    508

    Re: Event Listener for ComboBox

    I understand what your saying but the next question is how to implement it. I presume I assign each of the JComboBox options a defined variable and then use that for the calculations?
  9. Replies
    8
    Views
    508

    Re: Event Listener for ComboBox

    I sat around after I posted this and got it to work somewhat. I had a option message box appear and it would always give me a 0 or a 0.0

    Also when I do the calculations I need to convert from...
  10. Replies
    8
    Views
    508

    Event Listener for ComboBox

    I have the code for the JPanel and JComboBox and I want it so that when the user selects "Compact" from the combobox it the code then inputs 25 into a MPG variable and does it's calculations. The...
  11. Re: Trying to get two textBoxes and two JComboButtons to work with three dropdown boxes.

    the listeners are in the code, but that's the part I don't know is what or how to get the listener to "hear" what is being selected. I presume I add the code to this part "public void...
  12. Re: Trying to get two textBoxes and two JComboButtons to work with three dropdown boxes.

    I've got this part figured out from a previous assignment. What I haven't figured out is when I select say Bemidji to Darlington the coding to indicate that Bemidji was selected as the start and...
  13. Re: Trying to get two textBoxes and two JComboButtons to work with three dropdown boxes.

    It's supposed to calculate the total miles traveled by cost per gallon either manually input into the text field or using the dropdown for vehicle type. In essence user selects drop down for vehicle...
  14. Re: Trying to get two textBoxes and two JComboButtons to work with three dropdown boxes.

    Now if your wiling I need to code this so that when I select the various drop downs it will display my total costs. First I have to get the distance for all 6 drop down options and do all the...
  15. Re: Trying to get two textBoxes and two JComboButtons to work with three dropdown boxes.

    JLabel Miles = new JLabel("Miles planning to travel");
    JTextField distance = new JTextField(10);
    JLabel Fuelcost = new JLabel("What is the price per gallon/litre?");
    JTextField...
  16. Re: Trying to get two textBoxes and two JComboButtons to work with three dropdown boxes.

    I believe you are referring to JTextField distance and fuelprice?
  17. Re: Trying to get two textBoxes and two JComboButtons to work with three dropdown boxes.

    If i'm understanding your question correctly i've added them to the center.Panel and south.Panel and then added those panels to the layout in the container.

    --- Update ---



    For the text...
  18. Re: Trying to get two textBoxes and two JComboButtons to work with three dropdown boxes.

    I am trying to create an applet that will show drop down boxes that display fuel types (have that working) along with 6 cities to start from and destinations (got those also working). I am to have 2...
  19. Re: Trying to get two textBoxes and two JComboButtons to work with three dropdown boxes.

    I've gotten to the text fields are there but no button or anything else.


    /* Chapter 7
    *
    *
    */

    import java.awt.*;
    import java.awt.event.*;
  20. Trying to get two textBoxes and two JComboButtons to work with three dropdown boxes.

    I am not getting any compiling errors except warnings but the layout is working like it should. Using my text book I can create a JFrame with the panel and text boxes and I can create the JFrame...
  21. Replies
    12
    Views
    729

    Re: Gas Calculator

    Quick question. Is it possilble to add JComboBoxes to this or should I rewrite the whole thing? The book gives an example of a content pane with the ComboBoxes but they are doing different things...
  22. Replies
    12
    Views
    729

    Re: Gas Calculator

    Ok. Thanks for all the tips, i've got it all figured out.
  23. Replies
    12
    Views
    729

    Re: Gas Calculator

    I've done that and also turned the getFuelcost() into a method but now it's saying I can't have two (ints) for the method. I've already declared what the variables are so i'm puzzled why this isn't...
  24. Replies
    12
    Views
    729

    Re: Gas Calculator

    I've tried removing that and I still get the same error, the cursor though is right after fuelcost with the same error that it's expecting an identifier.
  25. Replies
    12
    Views
    729

    Re: Gas Calculator

    Line 83 is the line that i've bolded. Not sure about the semicolon's since they seem to be all correct unless i'm missing the obvious.

    Nice pic of Walter by the way.
Results 1 to 25 of 29
Page 1 of 2 1 2