Search:

Type: Posts; User: havinFun

Page 1 of 2 1 2

Search: Search took 0.28 seconds.

  1. Replies
    9
    Views
    1,093

    Re: Moving a shape across a panel

    OK, so I looked at the API doc for JSlider, from what I get I am supposed to create a method getValue() create an int that will grab slider.getValue. Am I on the right track? Then I will return...
  2. Replies
    9
    Views
    1,093

    Re: Moving a shape across a panel

    I do not want the size to ever change. I am not sure where I want the value to change of the shape, am I going to reference the center of the shape or the x and y position (top left corner of...
  3. Replies
    9
    Views
    1,093

    Re: Moving a shape across a panel

    the setD is to make sure that the radius is never a negative number and if it is then default to a radius of 10, but I see now that I am hard coding the size of the circle so I should need to have...
  4. Replies
    9
    Views
    1,093

    Re: Moving a shape across a panel

    Sorry, didn't realize that my imports were missing, here is the complete code:
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.EventQueue;
    import java.awt.Font;
    import...
  5. Replies
    9
    Views
    1,093

    Moving a shape across a panel

    Since I am pretty new to Java I have encountered some very trivial problems. I am working harder than I thought I would just to stay up with my class, but beyond that I need some help determining...
  6. Replies
    5
    Views
    271

    Re: Dumping a file

    sorry here is the entire code:
    import java.awt.Color;
    import java.awt.EventQueue;

    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import java.awt.Font;

    import...
  7. Replies
    5
    Views
    271

    Re: Dumping a file

    Here is the complete code:
    import java.awt.Color;


    public class Week03 {

    private JFrame frame;
    private final JLabel lblNewLabel = new JLabel("@ ! @ Hex Dump @ ! @");
    private final JLabel...
  8. Replies
    5
    Views
    271

    Dumping a file

    OK, I am creating a dump that prints out into a new file in hexadecimal format. I have written some code, but I am getting the wrong output. In the ActionListener (dump) button I am having trouble...
  9. Replies
    1
    Views
    424

    user input going to wrong ArrayList

    I am having trouble figuring out how to get my inputs to go to the right array list. Here is some of my code:
    public class Week01 {
    String givenName = null;
    String surname = null;
    String...
  10. Replies
    19
    Views
    787

    Re: ArrayList is returning null

    ok looks easy enough, I have tried to put this statement under my arraylist under the class method, I have tried in several places within my code and the add always stays underlined red???
  11. Replies
    19
    Views
    787

    Re: ArrayList is returning null

    in order to find the [] would I put in a print statement, those would come from the arrayList wouldn't they?
  12. Replies
    19
    Views
    787

    Re: ArrayList is returning null

    good question, if I leave it with nothing in there, Eclipse starts yelling at me. It is asking me to instantiate, the only way that I am not getting an error is to use null or new...
  13. Replies
    19
    Views
    787

    Re: ArrayList is returning null

    another quick question...
    do I need the following in the GUI builder method
    tfgiven.addActionListener(null);
    tflast.addActionListener(null);
    tfpersonID.addActionListener(null);...
  14. Replies
    19
    Views
    787

    Re: ArrayList is returning null

    hmm....ok. From the Person class I have a toString()
    public String toString() {
    return givenName + " " + surname + "\n" + phoneNumber + "\n" +
    streetAddress + "\n" + city + ", " +...
  15. Replies
    19
    Views
    787

    Re: ArrayList is returning null

    Here is what my program is doing:
    Customers:
    [null null
    unknown
    unknown
    unknown, unknown, 99999-9999]


    it should come out with givenName surname, customerID, phoneNumber, streetAddress,...
  16. Replies
    19
    Views
    787

    Re: ArrayList is returning null

    ok, so I have done that. In my CustomerListener method, am I correct in creating:
    private class CustomerListener implements ActionListener {

    public void actionPerformed(ActionEvent e) {...
  17. Replies
    19
    Views
    787

    Re: ArrayList is returning null

    hmm....ok I am following a little. I want the Customer class which extends the Person class in the ArrayList which will allow me to pull all the information I need into the arraylist.
    public...
  18. Replies
    19
    Views
    787

    Re: ArrayList is returning null

    ok, so I should have done the ArrayList like:
    ArrayList<Customer> mycustomer = new ArrayList<Customer>();
  19. Replies
    19
    Views
    787

    ArrayList is returning null

    I am having some issues once again with programming. I want to learn this stuff and have read and reread the materials but I am misfiring somewhere. Here is the code that I have written so far:
    ...
  20. Re: Matrix multiplying using separate input classes and a GUI

    the value of the finalMatrix should be the resultant from multiplying the two initial matrices together. So I want to pass the resultant to the toString finalMatrix, does that make sense?
  21. Re: Matrix multiplying using separate input classes and a GUI

    ok I added in print statements

    public void actionPerformed( ActionEvent e)
    {
    System.out.println("c" + c);
    System.out.println("c" + c.finalMatrix);

    ...
  22. Re: Matrix multiplying using separate input classes and a GUI

    now I am getting this error:

    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at MatrixGUI$MyButtonListener.actionPerformed(MatrixGUI.java:80)
    at...
  23. Re: Matrix multiplying using separate input classes and a GUI

    yes I realize this and I am struggling to get through this class with a decent grade, so I am using my resources to learn from. Thank you for making me feel really stupid here. I am asking for...
  24. Re: Matrix multiplying using separate input classes and a GUI

    ok...am I getting closer?

    // register the action buttons
    calcButton.addActionListener( new MyButtonListener() );

    buttonPanel.add( calcButton );
    }

    private class MyButtonListener...
  25. Re: Matrix multiplying using separate input classes and a GUI

    ok, I tried to add a parameter to the constructor, am I not doing this the right way. I have been trying to follow along with my book too.


    calcButton.addActionListener( new MyButtonListener()...
Results 1 to 25 of 42
Page 1 of 2 1 2