32,199 Topics
| |
I've been tryin to figure out how to pick numbers from the 'choices array' and put then into the results array. Can any body help me. I was thinking of adding a for loop but not sure. The code i got so far is below. import java.util.Random; import java.util.ArrayList; public … | |
I have called some numbers from a mysql database, they come out like this: [CODE]${parish.TotalHouseholds}[/CODE] Now what i would like to do is take the TotalHouseholds and TIMES it by 21.33% and display the answer in a separate cell and i was wondering if anybody could give me a plain … | |
Hi, Can we declare Char Array in Java instead of String Arrays? So we can manipulate them? or we have to use Strings and then use charAt() method for it? Thanks | |
hi, i actually had done similar programs many times and don't know why eclipse gave me strange output this time. anything possibly wrong? thanks [code] class RobotShop { public static void main(String[] args) { try { Scanner reader = new Scanner(new File("air.txt")); String robotName = null; String serial = null; … | |
Hi i have a java class called City and in this class i have this. [CODE] public class City { /** * read the file and make 10 objects * */ private String name; private double population; public City(String name, double population) { super(); this.name = name; this.population = population; … | |
So I am going through the "Getting Started Using Java RMI" and I get stuck at the following spot... [CODE] [B]javac[/B] -d [U]destDir[/U] Hello.java Server.java Client.java [/CODE] I use... [CODE] [B]C:\"Program Files"\Java\jdk1.6.0_11\bin\javac [/B] -d [U]C:\"Documents and Settings"\"Andrew Carrara"\Desktop\test\mysrc\example.hello[/U] Hello.java Server.java Client.java [/CODE] I get an invalid flag error. What exactly … | |
Im new to java and just trying to figure out the basics. i cannot figure out what is wrong with my program. Any suggestions on whats wrong? [code]4import java.util.Scanner; 5 6public class Lottery 7{ 8 public static void main(String[] args) 9 { 10 //Generate random lottery numbers 11 int lottery … | |
Hi, I have an int method that checks an array for a certain number. If that number is NOT found I won't to 'return null;'. I get this error "incompatible types" "found : <nulltype>" "required: int" How can I resolve this? thank you, Michael | |
Is there a method I can grab parent/grandparent nodes? The examples I have found appear to use only xpath statements to select nodes. Some of my failed attempts: /table/tr/td/b/font[self::text()="Nohup Files"] /table/descendant::font[self::text()="Nohup Files"] <table> <tr> <td><b><font>Nohup Files</font></b></td> </tr> </table> | |
Hey guys, I'm making a program that takes 3 sets of coordinates from a user to make a triangle. It then calculates the length of each side, the perimeter of the triangle, the area of the triangle, and the 3 angles. I have it all coded, except for the area … | |
Hi everybody, i am new to java and trying to develop a bit of an app i have created the first page, dynamicall filled a dropdown box all is fine i press the submit button and i get the error below: java.sql.SQLException: Parameter index out of range (1 > number … | |
I have the following code, which reads from the .csv file and simply displays the output as whatever is being read from the .csv file...(which is test1.csv in the test1.zip attached with this post) //class to read CSV file : import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; public class readCSV { … | |
[ICODE] import javax.swing.*; public class Tokenize{ public static String s[] = new String[100]; public static void main (String args[]){ String ask = JOptionPane.showInputDialog("Enter:"); isAsk(ask); } public static void isAsk(String ask){ StringTokenizer st = new StringTokenizer(ask," ",false); int input = Integer.parseInt(st.nextToken()); if(input<=10&&input>=0){ System.out.println(input); } } } [/ICODE] Here is the sample: … | |
Hi alll............. Please can someone help me to find a way to call for a c# function from a javascript which is in the web page of web browser included in a windows application....... Urgently need....... Please............!!!!!!!!! | |
the purpose of my program is to ask the user for their numerical grades (depending on how many total grades they have) and then they are given their letter grade. but i cant get the for loop to loop the question according to their number of total grades [code=JAVA] import … | |
I have two other classes but they are very small, and this is where the error lies. This is my code: [CODE]import java.util.Scanner; public class Player { private boolean isHuman; private int score=0; private Scanner input; public Player(int human) { System.out.println("If you would like to play, press 1. Otherwise, press … | |
does anyone know why this does not work? [CODE]public class AddStudentListener implements ActionListener { public void actionPerformed (ActionEvent event) { //Changes title Title.setText("Add Student"); //Obtians student information from the user Object[] possibilities = {"IB Computer Science", "AP Computer Science", "Algebra II"}; StudentClass = (String)JOptionPane.showInputDialog(All, "What class is \nthe new student … | |
Hi! I'm writing a program thats due tomorrow and I have a problem with one aspect: I can draw the picture I want and everything using paintComponent, but then when the user pulls the edge of the window, the program should resize the whole picture- redraw it i guess... How … | |
I am trying to read some numerical values from a file and getting this error: Input Error: Error in input: Floating point number not found.; Expecting Real number in the range -1.7976931348623157E308 to 1.7976931348623157E308 [code][code=java] import java.io.*; public class TriangleMain { /** * @param args the command line arguments */ … | |
The following code is producing this problem (typed with exact characters printed in command prompt, aside from quotations): "Please input D for a daytime movie or E for an evening movie: This is not a valid choice." The program will not allow me to input anything following the prompt for … | |
I'm having some trouble with my code. I want to calculate the final balances of some movie tickets based on their day or night showing (and depending on if they are children or adults). So at the end of the code, I've been trying to get the solution to a … | |
I need to figure out how to set my overall ticket limit (aticket + cticket) to 100 and if a customer goes over the limit, then they are told that they have ordered too many tickets and that they need to try again and then it loops back through until … | |
What I am trying to do is read from a file to an ArrayList and then display it using a JOptionPane. The only problem is the code i am having trouble with is in an ActionListener and I believe somehow I have created an infinite while loop because when I … | |
| Hello! First time Poster :) I'm trying to create a Java Web Crawler. What I want it to do is pass the crawler a starting site, a max depth/levels of sites to go to (as opposed to number of pages) and save files like images and documents. The problem is, … |
Please give me the problem related to java or C# thanks | |
ah im in 1st year IT student, my project is about to make a Notepad and it should have an event to perform. example: is when i go to [B]"file"[/B] then click the [B]"save"[/B] and it will perform.. pls give some example of class that use an event.. Im new … | |
I am creating a simple application using Swings . I am executing search on the database and result i have shown in table. My first query resulted in 8 rows which was shown clearly. Now on same frame i changed the search criteria and clicked search button. Now its resulting … | |
Hi all I am programming a database-related application in Java. I have to facilitate several different types of queries, but I'd like to use the same JTable to display the results of each query (one at a time, of course). The problem is that when I'm using one JTable, I … | |
I was wondering if someone could help me determine what to put in the actual parameters of the driver's class constructor since I am using scanner for the input. Driver receives the radius and color from the outside, it takes it to Circle to calculate circumference and area, then returns … | |
I have the following code which outputs incorrectly. [code] public static void extend(ArrayList priceList, ArrayList quantityList, ArrayList amountList){ for(int i = 0; i < priceList.size(); i++){ amountList.add((Double)priceList.get(i) * (Double)quantityList.get(i)); System.out.println(priceList.get(i) + " * " + quantityList.get(i) + " = " + amountList.get(i) ); } [/code] The output for some of … |
The End.