User Profile
Collapse
-
outside of my comment do you see anyhting wrong with the second block of code I posted? I don't have time to rewrite this, but if I cna't fix what I have I'll try. -
unfortunately I'm under a little bit of a time crunch and this is the last part of this code and I'm stuck. I guess what I mean by error is that fact that I simply don't know how to get the result set to print in the scroll pane.
...Code:final String UserInput = SearchText.getText(); SearchButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEventLeave a comment:
-
ResultSet ScrollPane problem
I am having trouble adding a result set to a scroll pane. no matter what I do using getText I get an error. Can someon give me a clue?
...Code:import java.util.*; import java.sql.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; import javax.swing.table.DefaultTableModel; public class MusicLibraryForm extends JFrame { -
I tried changing triangleType to private and I get an error and the same result "null". How do I go about making it private? Yeah, I know you change public to private, but I apparently can't do anything right with this....Leave a comment:
-
Ok I put everything in one application to make it easier to deal with and I updated my if statements. Based on what I have below can you show me how to fix this so the method call gives me the triangle type instead of "null"?
...Code:import java.util.Scanner; class triangle { //instance variables int side1; int side2; int side3; String triangleType;Leave a comment:
-
Here's the code for the triangle
...Code:class triangle { //instance variables int Side1; int Side2; int Side3; String triangleType; //constructor method for the three sides of the triangle triangle(int s1, int s2, int s3) { Side1 = s1; Side2 = s2; Side3 = s3; } //instance methodLeave a comment:
-
The user is prompted to enter three integers in a test class, this test class has the main method and executes what I'm trying to figure out.
Where is the syntax am I calling the function instead of the method? I'm not going to pick up on this unless someone shows me and lets me apply it to my own. I don't understand.
#3 is the reason I was here. I don't know how to call the method properly. I'm new to this....Leave a comment:
-
What should work? The method call doesn't work, no matter what numbers I enter or what order I enter them in. I've put in 10, 10 and 10 and gotten "null"
both the class and the test class compile without a problem, I just don't know how to fix the "null" print out....Leave a comment:
-
Yeah, I could add more if statements to make sure I dont get errors.
I need help calling the triangleType method to print the type instead of "null"Leave a comment:
-
if only 2 of the sides are equal it's an Isoscelese triangle. I'm losing focus from my original question....Leave a comment:
-
It's giving the if statements for the sides of an instance of a triangle and giving the correspsonding triangle type based on those if statements after the user inputs all 3 integers. I'm not worried about negative numbers or error checking right now. There are three type of triangles. 3 sides equal: Equilateral, 2 sides equal: Isoscelese and no sides equal: Scalene....Leave a comment:
-
How's this?
...Code:class triangle { //instance variables int Side1; int Side2; int Side3; String triangleType; //constructor method for the three sides of the triangle triangle(int s1, int s2, int s3) { Side1 = s1; Side2 = s2; Side3 = s3; } //instance method to determine theLeave a comment:
-
Triangle type issue
Can someone point me in the right direction on how to get the triangle type to display. Below is a triangle class that is tested by another completely separate class. The main method of the test class executes the code you see below. What I'm trying to figure out is what I'm doing wrong in getting the triangle type to print. the integers typed in by the user print fine, but I keep getting "null" for the triangle type because I don't... -
user input
I have prompr the user to enter three seperate values for the sides of a triangle. I know how to ask the user to input one value, but not multiples. Any help would be appreciated.
...Code:import javax.swing.JOptionPane; public class whatever public static void main(String [] args) { String input = JOptionPane.showInputDialog("Enter number here:");
No activity results to display
Show More
Leave a comment: