32,204 Topics

Member Avatar for
Member Avatar for oobokensilence

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 …

Member Avatar for stephen84s
0
131
Member Avatar for CoolGamer48

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

Member Avatar for Ezzaral
0
177
Member Avatar for suvirj

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 …

Member Avatar for peter_budo
0
125
Member Avatar for IMtheBESTatJAVA

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 …

Member Avatar for verruckt24
0
296
Member Avatar for jinuyasha

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

Member Avatar for VernonDozier
0
824
Member Avatar for pocku

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

Member Avatar for neilcoffey
0
192
Member Avatar for Superstar288

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 …

Member Avatar for stephen84s
0
178
Member Avatar for Tyster

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 …

Member Avatar for quuba
0
1K
Member Avatar for PhiberOptik

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 …

Member Avatar for neilcoffey
0
85
Member Avatar for Sereal_Killer

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 …

Member Avatar for neilcoffey
0
111
Member Avatar for PhiberOptik

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

Member Avatar for PhiberOptik
0
258
Member Avatar for Superstar288

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

Member Avatar for Superstar288
0
129
Member Avatar for robertmacedonia

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

Member Avatar for robertmacedonia
0
284
Member Avatar for clueless101

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

Member Avatar for stephen84s
0
184
Member Avatar for localp

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

Member Avatar for stephen84s
0
531
Member Avatar for robertmacedonia

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 …

Member Avatar for Tyster
0
143
Member Avatar for programmingme

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

Member Avatar for programmingme
0
142
Member Avatar for l_03

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 …

Member Avatar for jbennet
0
118
Member Avatar for puneetkay

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 …

Member Avatar for puneetkay
0
285
Member Avatar for goodluck4287

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 …

Member Avatar for stephen84s
0
75
Member Avatar for clueless101

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

Member Avatar for ~s.o.s~
0
125
Member Avatar for l_03

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

Member Avatar for stephen84s
-1
105
Member Avatar for Sgtplank

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 …

Member Avatar for Ezzaral
0
113
Member Avatar for it2051229

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 …

Member Avatar for Ezzaral
0
92
Member Avatar for ezkonekgal

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 …

Member Avatar for BestJewSinceJC
0
2K
Member Avatar for Generalcoco

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 …

Member Avatar for Generalcoco
0
87
Member Avatar for oldSoftDev

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 …

Member Avatar for jbennet
0
136
Member Avatar for das_das

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

Member Avatar for verruckt24
0
82
Member Avatar for tsr_tvsk

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

Member Avatar for stultuske
0
44
Member Avatar for zikojam

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 …

Member Avatar for stultuske
0
66

The End.