32,204 Topics
| |
Well to start off...here is my code. import java.io.*; import java.util.*; // my name public class project12 { static Scanner console = new Scanner(System.in); Scanner inFile = new Scanner(new FileReader("f:\\JAVA\\projects\\receipts.txt")); public static void main(String[] args) { int movies; double price; price=2.00; double change, cash, tax, total; System.out.println("Enter how many movies … | |
I'm trying to load a bitmap into an Image object using the following code: [CODE=Java] System.out.println("Point A"); System.out.println("Point B"); m_image = Toolkit.getDefaultToolkit().getImage(getClass().getResource(filename)); System.out.println("Point C"); MediaTracker mt = new MediaTracker(null); System.out.println("Point D"); mt.addImage(m_image, 0); System.out.println("Point E"); try { System.out.println("Point F"); mt.waitForID(0); System.out.println("Point G"); } catch (InterruptedException ie) { System.err.println(ie); System.exit(1); } … | |
Hi, I am kinda new to java netbeans...i have downloaded some java code which is n implementation of the algorithms in the book AI:A Modern Approach. After extraction, the folder has bin, build, doc and src folders which hold various .class and .java files. Now my problem is that i … | |
I've been given a project in which I have to find the highest and lowest possible product using 3 2-digit numbers without repeating any numbers. For example, the algorithm for the highest would be: 7n * 8n * 9n where the n's would be 4, 5, or 6. The algorithm … | |
Hello, first time poster here. So if I come off as asking something so hastily and quickly my bad, but currently I'm creating a clock class on DrJava. This is what I have so far. [code] clock.java import java.util.*; import java.text.*; public class Clock {private int hours; private int minutes; … | |
I'm working on a quick sort algorithm using recursion but it's throwing a stackOverflowError. Here is the code: [CODE] public static void quicksort(int [] A){ quickSortRec(A, 0, A.length-1); } public static void quickSortRec(int [] A, int p, int r){ if (p < r){ int q = Partition(A, p, r); quickSortRec(A, … | |
sorry to bother all of you again but i was just wondering if i can use the same arraylist more than 1 time. this is for my project i have to create a gui for a pet store and a pet can be either a : mammal,reptile,fish or bird. so … | |
Hi Folks, I am encountering what I think is a simple problem but I haven't been able to solve it. I am trying to parse a simple XML file and I keep getting the following exception... Exception in thread "main" javax.xml.transform.TransformerException: A location step was expected following the '/' or … | |
Hey guys, I have a program that I want to launch and pass a parameter. For example: [QUOTE]"C:\Program Files\aProgram\test.exe -login joeSmith password1"[/QUOTE] The thing is I can't just add that to a shortcut because lots of other people will be using this computer as well. Is there a way of … | |
I have a basic problem i dont know where the error lies. i can create a class Persoon and fill in all its values before its created . but for some reason when i call up the information i get the current Date as the birthdate and not what i … | |
Hey folks, I have come upon what seams to be a very basic problem, but I have read my text book over and over and I can't figure out how to write to a specific line of a text file. For example each line of my text file looks like: … | |
hi i was doing some work for my project in a gui and i wanted to print out the information in my arraylist but when i do print out the object all i get is Customer@197d257 i have used the follwing code to print it out of my iterator [CODE] … | |
Hi, I have this little program with two classes in it. The first class Kontakt (Contact in english) contains information about a person (name,surname and number). Now, in the PhoneBook class I am trying to implement a LinkedList <Kontakt>, i.e. a list of contacts. Now, all the methods work fine, … | |
[QUOTE]I'm working on a seemingly simple application that has 2 text fields and a slider. In the 1st text field the user enters an amount and the associated sales tax is displayed in the 2nd text field. Then, by moving the slider up and down the specified range, the user … | |
i want to display a PDF file in a JFrame .. how do i code it, can some one send me the code for this.. i googled, it but couldn't find any .. plzz help me | |
Hello, I'm new in Java programming, just learning it and I want to ask you about the Exceptions. As much as I understood, I just need to create a class e.g. "MyException" that extends the Exception class, and use the exception specification "throws" in the function that might throw the … | |
My program keeps looping when asking for seat letter. Can anyone help me out as to why that is? [CODE] import java.io.*; import java.util.*; public class AirplaneSeating { static Scanner console = new Scanner(System.in); public static void main(String[] args) throws IOException { char[][] seatPlan = new char[13][6]; char response; initializeSeatPlan(seatPlan); … | |
help guyz...our teacher recommend us to download the "source code" of eclipse. jcreator, net beans, and bluej,,, i am either confused,,,,what are the source codes of this four????are these the .java file???help guyzz,.....i cant seem to find their source codes since i dont even get the idea of what are … | |
Hello everyone, Im trying to write Punjabi (Gurmukhi) by Unicode. I have the Unicode code point of all character and Code Block is Gurmukhi. [CODE=java]System.out.prinln("\u0A73")[/CODE] u0A73 = GURMUKHI URA = ੳ but its showing "?". then i tried with PrintStream [CODE=java]String unicodeMessage = "\u0A73"; try { PrintStream output = new … | |
Just got the wonderful Line is longer than 80 characters error. I realize this could very well be a n00b question ;-) I tried splitting after the ":" putting both lines in brackets and connecting them with + " but didn't work well for me, anyone know how? [CODE] public … | |
[quote] Once again, I can get part of my code to work, but not all. When the user inputs more than one sentence [I](ending with either a period, question mark or exclamation point), [/I]each sentence should be capitalized accordingly. However, it only works with the first sentence to work. Does … | |
guyzz...do you know best tutorial in JOptionPane??especially with their dialog features,,,i really want to make a program,,that can be look a like as GUI Application,,,using only JOptionPane...i hope you can help me guyzz....thank you... | |
hey guys, ok ive got a program ive got to hand in fast, practicaly works just got to errors so a quick reply would be greatly appreciated. [code=java] import java.util.*; import java.io.*; class Assignment7{ public static void main(String[] args)throws Exception{ File input1 = new File (args[0]); File input2 = new … | |
I'm creating a java program that in every second there is a data stored into my table. I made use of THread.sleep(1000) to pause the for loop in every second.. But when my program runs, it freezed for 10 seconds because of the condition of my for loop where the … | |
i am trying to write a code that stimulates an simple ATM. i have two class, one for the Bank Account and another for the ATM itself. [code] public BankAccount(String name1, int acctNum, int pinNum ){ name = name1; accountNumber = acctNum; pinNumber = pinNum; balance = 100.00; } public … | |
This is my Final Project and as you can see my program asks the users twice for the test grade I am trying to consolodate and have the program only ask for the test score once and give the letter grade at the same time.? any ideas I do not … | |
I just started java installed everything that I was required. I just completed my python class. for just trying a java code I tried this code. code: [code=java] /** * This program lets the user play HighLow, a simple card game * that is described in the output statements at … | |
hello there are 19+ sets of Mock test for SCJP 6.0 and SCJP 5.0 available at [[link removed] It is help full for all so i am putting here ... I am not the owner of the website .. | |
Hi everybody. here i have a problem with hashtable. i am storing hashtable in session scope and i want to validate that hashtable with javascript in next jsp . how suresh kumar | |
Hello The table's cells contain integer values. I would like to save each one of theme them in an array of integers. The problem is, I don't know how to do so. I tried to use the getValueAt method, but I always get error messages. I tried something like: [CODE]Object … |
The End.