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...
Type: Posts; User: havinFun
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...
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...
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...
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...
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...
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...
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...
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...
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...
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???
in order to find the [] would I put in a print statement, those would come from the arrayList wouldn't they?
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...
another quick question...
do I need the following in the GUI builder method
tfgiven.addActionListener(null);
tflast.addActionListener(null);
tfpersonID.addActionListener(null);...
hmm....ok. From the Person class I have a toString()
public String toString() {
return givenName + " " + surname + "\n" + phoneNumber + "\n" +
streetAddress + "\n" + city + ", " +...
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,...
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) {...
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...
ok, so I should have done the ArrayList like:
ArrayList<Customer> mycustomer = new ArrayList<Customer>();
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:
...
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?
ok I added in print statements
public void actionPerformed( ActionEvent e)
{
System.out.println("c" + c);
System.out.println("c" + c.finalMatrix);
...
now I am getting this error:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at MatrixGUI$MyButtonListener.actionPerformed(MatrixGUI.java:80)
at...
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...
ok...am I getting closer?
// register the action buttons
calcButton.addActionListener( new MyButtonListener() );
buttonPanel.add( calcButton );
}
private class MyButtonListener...
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()...