32,199 Topics

Member Avatar for
Member Avatar for jtodd

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 …

Member Avatar for jtodd
0
123
Member Avatar for keny2020j

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 = …

Member Avatar for keny2020j
0
213
Member Avatar for Megalodeez

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; …

Member Avatar for JavaNewbieEK
1
358
Member Avatar for Megalodeez

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. …

0
47
Member Avatar for Alex_

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.

Member Avatar for Alex_
0
168
Member Avatar for achiman

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 = …

Member Avatar for jwenting
0
169
Member Avatar for hendaz

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 …

0
62
Member Avatar for hockey87

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 …

Member Avatar for gangsta1903
0
91
Member Avatar for ilupilu

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 …

Member Avatar for javaAddict
0
80
Member Avatar for rEvOLt

[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 = …

Member Avatar for javaAddict
0
105
Member Avatar for ehsun7b

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 …

Member Avatar for Nick Evan
0
214
Member Avatar for Alex_is

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) …

Member Avatar for jothibasu
0
170
Member Avatar for ctsarsh

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 …

Member Avatar for masijade
0
180
Member Avatar for ceyesuma

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 …

Member Avatar for ceyesuma
0
73
Member Avatar for xxunknown321

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 …

Member Avatar for BestJewSinceJC
0
152
Member Avatar for need

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) { …

Member Avatar for AbhikGhosh
0
153
Member Avatar for motress

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, …

0
42
Member Avatar for ctsarsh

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 …

0
54
Member Avatar for XodoX

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 …

Member Avatar for BestJewSinceJC
0
112
Member Avatar for Dizzzy

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?

Member Avatar for gangsta1903
0
116
Member Avatar for dhana.519

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 . …

0
60
Member Avatar for zup7778

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 …

Member Avatar for Ezzaral
0
134
Member Avatar for emanicom

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 …

Member Avatar for emanicom
0
149
Member Avatar for need

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; …

Member Avatar for Ezzaral
0
171
Member Avatar for emanicom

/* 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 …

Member Avatar for emanicom
0
142
Member Avatar for emanicom

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 …

Member Avatar for emanicom
0
182
Member Avatar for msr

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 …

Member Avatar for BestJewSinceJC
0
73
Member Avatar for shawnfrancis

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 …

Member Avatar for stultuske
0
164
Member Avatar for Aisha25

(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 …

Member Avatar for BestJewSinceJC
0
988
Member Avatar for pocix

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 …

Member Avatar for pocix
0
113

The End.