32,199 Topics
| |
Hey everyone! I am a newbie to java and I have what is probably a simple question. I have add a program I am working on to randomly display random numbers from 104, 105, 106, and 108. I have gone about this by creating an array and storing the numbers … | |
My code is : /* Database.java*/ [code] import java.sql.*; import java.awt.*; import javax.swing.*; public class Database{ private static Connection con = null; public static Statement statement = null; public static void makeConnection() { JOptionPane.showMessageDialog(null, "database"); String driver = "sun.jdbc.odbc.JdbcOdbcDriver"; String url = "jdbc:odbc:lib"; String username = ""; String password = … | |
Write a program to calculate a students GPA. What I cant figure is how to calculate ( Total= credit * grade + credit * grade...etc) or (GPA = Total/grade +grade etc...) If you run this program, you will see my calculation off by a lot. Please help. [CODE] import java.util.Scanner; … | |
Write a program that calculates and displays the mortgage payment Also list the loan balance and interest paid for each payment over a the term of loan. Use loops to display a partial list, hesitate and display more of the list. Im completely lost. any help will be much appreciated. … | |
I'm trying to do the following: [code=java] private void butonActionPerformed(java.awt.event.ActionEvent evt) { buton.setLocation(500, 500); } [/code] but it doesn't do anything. Please help. | |
Hey I am trying to create a java chat server but I am get an exception: exception in thread main java.lang.arrayindexoutofboundsexception 0 I know it means the index is out of bound but can any please tell me what I am doing wrong, I want to assign the port = … | |
Hi, I am trying to implement a bottom up heap construction. I seem to have the recursion working but im not sure how i am supposed to combine the trees at each stage. My heap is based on the arraylist complete binary tree. For example, the image below shows what … | |
I need to write a program that prompts the user to enter 4 numbers (x1, x2, y1, y2) and the program should output the circles area, diameter, circumference, and area. I have to create these methods, distance, radius, circumference and area. I have the code done but everytime i enter … | |
can anyone tell how to write in core java using command line arguments : a) to print prime numbers from 1 to n b) to calculate the length of input string c) to find whether the number is odd or even d) to convert dollar in rupees e) to accept … | |
[I]<<thread split from [URL="http://www.daniweb.com/forums/post731500.html#post731500"]here[/URL]>>[/I] [QUOTE=destin;731502]You'd compare an object to [icode]null[/icode] with [icode]==[/icode]. I think you want one of the following. It's hard to determine the exact behavior you're looking for from your code. [code=Java]if (child == null) child = new Lista(c, null); // Or: if (child.getData() == null) child = … | |
Hi I'm using [B]NetBeans + GCC[/B] in Linux and also [B]NetBeans + MinGW[/B] in Windows. I need to run an OS Command e.g.: [ICODE]java -jar myjar.jar[/ICODE] I prefer [B]not[/B] to have the terminal/cmd window. It works fine in Linux, but in windows, it ends up in opening a [B]cmd[/B] window … | |
This is the code i have for my stack program: public class MyStack { private int top; private int[] store; Stack(int capacity) { if (capacity <= 0) throw new IllegalArgumentException("Stack's capacity must be positive"); store = new int[capacity]; top = -1; } void push(int value) { if (top == store.length) … | |
i need to convert this java code to java applet code here in my java code: import java.io.*; import java.util.*; public class fyp { static int t_value=2; static int no_of_parameter = 0; String binary_setting; static int data[]; static ArrayList<String> constraint = new ArrayList<String>(); static ArrayList<String> seeding = new ArrayList<String>(); static … | |
If I run my program. a GUI shows. clicking the combox. calls a series of classes that produce what text needs to be in the textfields so one of the classes calls fillSetters which is in a class that extends the GUI so "this" should be an instance of the … | |
How do i compare two linkedLists so that the onutcome is a sorted linked list from least to greates. Heres my code so far. list1.txt 1 2 3 7 9 10 13 list2.txt 4 5 6 8 11 12 14 how do i compare the two and make it into … | |
I need to sort the students in array in ascending order of first name. I tried to do arraylist but it didn't work. Can someone please help me with this? Student.java [code] public class Student { private String firstName; private String lastName; private String studentNumber; Student(String fName,String lName,String sNumber) { … | |
00:24:c3:31:2b:e0 -93 00:12:17:7b:33:04 -80 00:1f:27:55:f7:70 -70 00:1e:13:ee:3e:40 -85 00:24:c3:31:b8:80 -91 00:90:4c:60:04:02 -94 00:1b:0d:d6:6d:50 -70 00:1a:a2:dc:a0:60 -86 00:1e:c1:4c:c5:ce -94 00:24:c3:31:b8:80 -91 00:1e:c1:4c:c5:ce -94 00:1a:a2:dc:a0:60 -91 The above is part of my .txt file, is there any method to calculate the average value for each ID ? The first part is ID, … | |
i need to convert this java code to java applet code here in my java code: [CODE]import java.io.*; import java.util.*; public class fyp { static int t_value=2; static int no_of_parameter = 0; String binary_setting; static int data[]; static ArrayList<String> constraint = new ArrayList<String>(); static ArrayList<String> seeding = new ArrayList<String>(); static … | |
Hello, I got an car inventory program that stores the names of cars etc. I thin a class arraylist would work better. Like an array that can "grow" and "shrink". But I do not know how to convert the code from array to arraylist. It should still keep the member … | |
Is there a way to setup a jFormatted Field and retrieve a int value using getValue()... I am abit lost. [CODE] private jFormattedField CsNumber = new JFormattedField(); [/CODE] Also is there a way of restricting the value being input to only being a number and not negative? | |
Hello: i am try to run xml parsing example in j2me with Netbeans 6.8 for cldc but when i compile it gives following Error: error preverifying clas bin.EventList Class loading error: Wrong name i am using kxml2 jar file for importing org.kxmlparser. can any tell what is this error . … | |
I am getting the error, cannot find symbol- Constructor employee (blahblahblah) heres the employee class it compiles fine.... public class Employee extends Person { private double salary; private int emplId; private String emplType; private String emplTypeDescr; private String firstName; private String lastName; public Employee(String firstName, String lastName, double salary, int … | |
I just want to know If I can combine the 2 codes together, that I created, or do I have to start over? The new assignment is to: Use an array for the different loans. Display the mortgage payment amount for each loan. Then, list the loan balance and interest … | |
I have two classes. Student and StudentTest. My test class wil read the student info from the command line. I also need to check if the student already exists with equals() method. Can someone help me with this? Student [code] public class Student { private String firstName; private String lastName; … | |
/* PRG/420 Week 3 Assignment: Mortgage Calculator Program Programmer: Eva Manicom Date: March 1, 2010 Filename: Mortgage Calculator Program Purpose: Modify the mortgage program to display the mortgage payment amount. Then, list the loan balance and interest paid for each payment over the term of the loan. The list would … | |
The top code is my Loop for the mortgage program. The second code is my Array list for the Mortgage program. Is there a way to combine the 2 to do the following:* Use an array for the different loans. Display the mortgage payment amount for each loan. Then, list … | |
Hello, I would like to declare a class atribute so I wrote something like this: [CODE] class Xpto{ private static int value; }[/CODE] However, once is private, I cant access it like Xpto.value nor a.value ("a" is a Xpto instance) Declaring it protected I can access it through class and … | |
I am going to come right out front and say I am in computer science class and we are working on java code and I am needing help. I keep getting an error message that reads: ComputeChange.java:4: class, interface , or enum expected java.swing I understand that it is telling … | |
(Science: wind- chill temperature) How cold is it outside? The temperature alone in not enough to provide an answer. Other factors including wind speed, relative humidity, and sunshine play important roles in determining coldness outside. In 2001, the National Weather Service (NWS) implemented the new wind chill temperature to measure … | |
hi everyone i need help how to -creates an array for 5 integers and store it in array -use the highest & lowest integer and cube it i stuck in array, i confuse how to input integers to array with JOptionPane so far for the input [CODE] import javax.swing.*; import … |
The End.