32,204 Topics
| |
Hi everyone... I just finished making a program for Video Rental in java..its not much..just retrieves the data from the DB and we can add or edit it...it works perfectly. But now, i want it to display the "Client Name" and "Client ID" field from my Client table and "movie … | |
I'm having trouble with the calculate mean method in my Average Driver. The Average class is fine it's just declaring the objects and instantiating them I'm having a problem with. Any help would be greatly appreciated. [CODE]import java.util.Scanner; public class Average { Scanner input = new Scanner(System.in); private int[] data … | |
can somebody help. i m getting following errors. i m creating postfix calc C:\Users\Hamza\Pictures\CalcGUIPanel.java:204: int cannot be dereferenced Integer arg2=resultValue.pop(); ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:205: int cannot be dereferenced resultValue.push(resultValue.pop()+arg2); ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:205: operator + cannot be applied to <any>,java.lang.Integer resultValue.push(resultValue.pop()+arg2); ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:205: int cannot be dereferenced resultValue.push(resultValue.pop()+arg2); ^ C:\Users\Hamza\Pictures\CalcGUIPanel.java:211: int cannot be dereferenced … | |
Hello programmers, 1. could give me an[b] example code[/b] how to set up username and password for the service, which have been created using wsdl file, which has been given from web service creators on other side of the world. Web service client has been created using NetBeans IDE. When … | |
hi When i try to run a program in java to connect sqlserver 2005. Igetting the following error. java.sql.SQLException: No suitable drivers found for jdbc:microsoft:sqlserver://127.0.0.1:1433; DatabaseName=name I added the classpath properly for sqljdbc.jar file in envirnomental variable. But still i getting an error. If anyone knows the solution for this … | |
Hello everyone at Daniweb! This is my first post here, sorry if i do something wrong. Ok, so just a quick background on me and where I'm at in java. This year I'm taking my first Comp Sci class as CSUN (Cal State University Northridge). I am a complete beginner … | |
I'm trying to write a test class which shows the user the following menu and implements all options. The program should continue to run and process requests until the user chooses to exit. The program should double-check that the user really wants to exit. All input must be validated and … | |
Hey guys! I'm trying to figure out how to create a program that lets the user find a picture on the hard drive and display the picture. How can I accomplish this? | |
Hi, I have an XML, I need to create 2 classes: 1. For converting XML into XSD for getting its node objects. 2. For fetching values in each node. I have to use JAX-B for this but I don't know the steps. Please suggest some procedure or decent tutorials I … | |
I have a tic tac toe board i am finding it hard to figure out how to change parts of the array that contains char. I am looking for a way to to ask the user to select a char to change in the the array and then once they … | |
I m new.I am not getting any result for Number of A Number of B Numbers of C Number of D number of F for A,B,C,D,F i always get 0. [CODE]import java.util.Scanner; public class ExamScores1 { public static void main (String[]args) { String a; int count= 0; int grade=0; // … | |
I am trying to read a file using a string input as the filename. For example, if the filename is datafile.txt then if the input is "datafile.txt" and there is a file of that name in the directory, how do I read it? Here is my initial code: [CODE]Scanner kbd … | |
Hi all, Does anyone know how to read a .doc file with reader in java? Is it possible to read a doc file the same way you read a txt file? Thanks in advance | |
it says can not find symbol.... [CODE]import java.util.Scanner; public class wage2 { private static Scanner Reader= new Scanner (System.in); // private static double OverTimeRate=1.5; public static void main(String[] args) { //constants double person_Name; double hourly_wage; double regular_hours; double overtime_hour; double regularpay; double overtimepay; double totalpay; person_Name=InputPersonName(); hourly_wage=InputhourlyWage(); regular_hours=InputRegularHours(); overtime_hour=InputOvertimeHours(); regularpay=regular_hours … | |
I can't get the object array in lab9 class (named "thelist") to be populated with objects from the Foreign class. please see line 35 in lab9 class. I've tried using toString, useing a Foreign type variable as a parameter in a addData(), a addData() method ect... I am really really … | |
I am new to Java and I am having trouble knowing if my array is populating when I click the enter button and printing out the data into the text area when I click the run reports button. When I put data in the text boxes the boxes are being … | |
Ok so my problem should have a fairly simple fix. My program takes the number of families and their income and prints the families that make less than 10% of the maximum income. Below is a sample run. Please enter the number of families: 5 Enter an income: 8500 Enter … | |
My problem is in the guessing method, I am not sure if the way I set up playing the game again works, (don't know if entering yes will work) and I'm not sure on how to call the main method to play again, and also I'm suppose to give the … | |
No I know that in order to compare a String you have to call its method .equals but how I check if a String is NOT equal to something? Will it be something like if ("hello" != String.equal())?? or is there a special method? I know I'm being dumb here … | |
I'm getting Error: `<identifier>` expected and not sure why, any tips? public class BioCalc { // instance variables private Date myToday;//Date object today private Date myBday;//Date object birthday private int myDaysAlive;//birthday-today private final int PCYCLE=23;//physical length private final int ECYCLE=28;//emotional length private final int ICYCLE=33;//intellectual length /** * Constructor for … | |
Hello. I'm attempting to start a Caesar cipher program and can't get the program to display the output key[1]. Here is my code: [CODE]import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class Caesar { private String[] key = new String[26]; public static void main(String[] args){ Scanner kbd = new Scanner(System.in); String … | |
Can anyone develop the Ideal height calculator with following specifications? The picture of required software is attached Write the ideal weight calculator so that height in inches is entered by using a slider. Use the approximate formula: W = H2 / 30 , for female W = H2 / 28 … | |
i am trying to put this together so it opens a file sorts the data saves a file and appends a file i have got my self so confused. can any one help???? this is the code Ive got so far. [code]import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; import java.io.FileWriter; import … | |
Hi everyone I have an exam coming up soon, and now is the time for review. I have some questions regarding this review, I will only ask the ones I am so unclear about. [CODE]How many times will the following do-while loop be executed? int x = 11; do { … | |
[CODE] package primecdesc; import java.util.Scanner; public class Primecdesc { public static void main(String[] args) { Scanner myScanner = new Scanner (System.in); int a,b=0,ctr=0, ktr=1; System.out.print("Enter a number: "); a = myScanner.nextInt(); while(b>=1001) { if (a%b==0) b++; ctr--; } /*for(b=1;b<=1001;b++) { if(a%b==0) ctr--; }*/ if(ctr==1) { System.out.println(a + " is a … | |
I get this error in my Java programme which coded by me according to a tutorial.I coded it to connect my Java App with MySql database.This is the code.[CODE]package Gui; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import java.sql.SQLException; /** * * */ public class connectionconfig { private connectionconfig() … | |
I want display 2nd cycle after sleeping 1st cycle time 1 second after that display 2nd ,3rd and so on.... I bold my thread code in above program.... [CODE] public class MainDrawCycle extends JPanel implements ActionListener ,Runnable { JButton button; JLabel lblclkValue,lbldispValue,lblTitle; JTextField textField; JScrollPane pane; JPanel panel; JFrame frame; … | |
hey i have written this code to make a GUI but it compile correctly but gives error at run time. the error is exception in thread main "java.lang.NullpointerException" at GUI.intGUI(GUI.java:22) at GUI.(init)(GUI.java :75) at GUI.main (GUI.java:79) the code is [CODE]import java.awt.*; import javax.swing.*; import java.awt.event.*; public class GUI { JFrame … | |
import java.util. *; import java.util. ArrayList; public class Module { private int moduleCode; private String classlist; private ArrayList<String>studentsEnrol; public Module(){ studentsEnrol = new ArrayList<String>(); } public void storestudent(String student){ studentsEnrol.add(student); } public String classlist(){ return classlist(); } This is a code i wrote, the code meant to store student in … | |
i need to know which is better? whether DataInputStream or BufferedReader or scanner? |
The End.