35,618 Topics

Member Avatar for
Member Avatar for wowz

[CODE]/** Generates the n'th Fibonacci number */ import java.util.* ; public class FibonacciGeneratorTester { public static void main(String[] args) { System.out.println("The 1st Fibonacci number is: " + getFibonacci(1)) ; System.out.println("Expected: 1") ; System.out.println("The 3rd Fibonacci number is: " + getFibonacci(3)) ; System.out.println("Expected: 2") ; System.out.println("The 5th Fibonacci number is: " …

Member Avatar for kramerd
0
181
Member Avatar for sciprog1

Hello Members, I have three balls(all JPanels) bouncing in a JFrame. Following are the files: BouncingBalls.java: [CODE]import javax.swing.*; import java.awt.*; class BouncingBalls extends JFrame { public BouncingBalls() { setResizable(false); setSize(400,400); Ball ball1 = new Ball(); Ball ball2 = new Ball(); Ball ball3 = new Ball(); ball1.add(ball2); ball2.add(ball3); getContentPane().add(ball1); setVisible(true); Thread …

Member Avatar for sciprog1
0
2K
Member Avatar for ITmajor

hi everybody,,, please i need your help in my project if you don't mind my project is to create an array with size of 10 that allow you to inter 10 students, their id number and thier marks and show the average of the marks as a,b,c,d,and f thats it,,, …

Member Avatar for peter_budo
-2
136
Member Avatar for Kerrai

Greetings So i'm trying to figure out how regex works and already run into a roadblock. I figured out the easier ones, if a string only consists of numbers or letters. But these required a little more thought it seems. These are three random linen that i need to check …

Member Avatar for Taywin
0
130
Member Avatar for ZozOQ

Hello i am new here, i want to ask about a problem of mine. I have made a server code, so i can send commands from other program C# i made that but my problem is when i start the java program because is Loading. The Server is starting at …

Member Avatar for kramerd
0
191
Member Avatar for wowz

[CODE] import java.util.* ; public class CurrencyConverterTester { public static void main(String[] args) { Scanner scanner = new Scanner(System.in) ; System.out.println("How many euros is one dollar?") ; String input = scanner.nextLine() ; double rate = Double.parseDouble(input) ; CurrencyConverter converter = new CurrencyConverter(rate); boolean done = false; while (!done) { System.out.println("Dollar …

Member Avatar for wowz
0
178
Member Avatar for soccer13

Hey guys, I got such great help last time I decided to come back for more :). Hope I'm not bothering with these questions, my teacher isn't much for being nice or explaining.. Right now we are getting into methods, I know that they aren't that difficult but I for …

Member Avatar for peter_budo
0
79
Member Avatar for adaniel058

I can not figure out why my code is reading in data to my vector in funny ways. I have added the input file and necesary class to test. It seems to be skipping values in the input file and also adding things to seperate places in the vector instead …

Member Avatar for kramerd
0
235
Member Avatar for manonfire89

Hey guys i have been told to do this Bank account program as you can see the description below, what i have so far is a program that i can create the bank accounts and delete them within the Frame, what i cant get working is the withdrawing the balance …

Member Avatar for Taywin
0
217
Member Avatar for opeomotayo
Member Avatar for peter_budo
0
33
Member Avatar for purijatin

I am facing this problem where one thread keeps adding packets which it receives from the network to linkedlist. And the other thread retrieves it from the linked list. The below is the code of the Thread which keeps receiving the packets and add's them to list. [CODE] private class …

Member Avatar for JamesCherrill
0
91
Member Avatar for homeryansta

I created a piece of code that simulates a pendulum with the gravity(assuming no friction or resistance). However, it is not as smooth as I want it to be. So.. does anyone know what I can do to make it smoother? [CODE=java] import java.awt.*; import java.awt.event.*; import java.lang.Math; import java.lang.Runnable; …

Member Avatar for Eric Cute
0
308
Member Avatar for amitbhanot

Hi I have started doing servlets. I am stuck somewhere. I have installed weblogic server and also configured it. I have also installed the J2EE SDK on my machine. But when I compile my servlet program, it says javax.serlvet.http.* and javax.serlvet.* packages are not found. Please help me out how …

Member Avatar for amitbhanot
0
112
Member Avatar for Checkerboz

Hi, I'm reading this book about Java right now and in it was this example so I wrote it off and tested it... I get the error "Exception in thread "main" java.lang.NoSuchMethodError: main" and from what I've understood it's because I am missing a main class... Here's the deal though: …

Member Avatar for Dhruv Gairola
0
165
Member Avatar for haxtor21

Hello Daniweb. I am trying to make an application for a ATM machine (class homework). This is the schematic that I followed [url]http://www.screencast.com/users/haxtor21/folders/Jing/media/303e583a-8f90-46f3-8ed1-a35dde2200bb[/url] My issue is that I'm trying to access a text file and search for a account ID. After the account ID i am doing a nextDouble and …

Member Avatar for haxtor21
0
187
Member Avatar for blurX

I'm doing a phone number conversion program. I created a method to convert the letter to numbers, and a method to format the phone number(dashes after 3 and 6 numbers). Both methods return a value. I don't want to post the entire program, but the calling method in the main …

Member Avatar for group256
0
107
Member Avatar for gedas

hey everyone, i have few text files that contain some data. what i need is to be able to display those file names in JTextArea and if the number of text files increase/decrease i would want the file names automatically change in the JTextField(after next compilation). i would be very …

Member Avatar for Eric Cute
0
48
Member Avatar for computercoder

I am writing a program that is supposed to count the number of vowels in an inputted (by the user) body of text. [CODE] import java.util.*; public class Vowels{ public static void main(String[] args){ Scanner console = new Scanner(System.in); int counter= 0; System.out.println("\nInput a sequence of characters"); String text = …

Member Avatar for Eric Cute
0
104
Member Avatar for ssubnel

I could not get this past my editor, and am not bright enough to understand why. My TA and I do not share a common language fluency and I do not understand remotely what he is saying. Can anyone tell me why this doesn't run? [CODE]import java.util.Scanner; public class sumMatrix1 …

Member Avatar for ssubnel
0
95
Member Avatar for TankMontna

Hi, I need a little help, i found out to repeat an action/animation automatically I need to use a timer but im having troubles implementing it into my script. This is the last few part of the action... public void slowMoveVertical () { sun.slowMoveVertical(-100); } Now I what I want …

Member Avatar for Ezzaral
0
188
Member Avatar for coco24

I have to write a code that displays a 4 x 4 grid of faces. I am stuck and this is wat i have so far: [code] import java.awt.Graphics; import java.util.Scanner; import javax.swing.JApplet; public class Program7 extends JApplet { public void init() { setSize(2000, 2000); } /** * Draw one …

Member Avatar for kramerd
0
144
Member Avatar for AaronLLF

Hopefully this is my LAST QUESTION!! D:< Anyway, I saw a code on lloydgoodall.com for an LWJGL FPCamera. It had SEVERAL errors, but I finally got to the (hopefully) last error. "Keyboard must be created before you can query key state" My code: [code] import org.lwjgl.Sys; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.GL11; …

Member Avatar for Ezzaral
0
879
Member Avatar for hoshumaruh

Hi! Is it possible to retrieve XML data and input it to mysql database using JSP? If so, how will I do it? I'm new to java by the way. Thanks in advance to those who will reply!

Member Avatar for peter_budo
0
94
Member Avatar for vbx_wx

[code] import java.util.*; package everything_is_an_object; class MyClass { int i; char c; } public class Main { public static void main(String[] args) { MyClass x = new MyClass(); System.out.println(x.i); System.out.println(x.c); } } [/code] My error is on the second line,that was generated by my IDE,with the package. What si the …

Member Avatar for Ezzaral
-1
88
Member Avatar for peterwalter

I have to create a class called Polynomials and other called PolynomialTerm. The latter one to copy, add and multiply PolynomialTerm (exponents, coefficients). I also have to do the same for the Polynomial(which is an arrayList of PolynomialTerms). I am having problems adding the two polynomials.I need to do this …

Member Avatar for dierobe
0
412
Member Avatar for sciprog1

Hello, I have a project in BlueJ, called Game. Inside this project, I have the following files: File_A - A JApplet file which creates instances of Class_A and Class_B and calls their respective member functions. File_B - Implements Class_A (a JPanel) File_C - Implements Class_B( a JPanel) In order to …

Member Avatar for sciprog1
0
79
Member Avatar for virendra_sharma

Hi , i have created web application in that i want to get the facebook user profile like image, name , education etc. can any one plz suggest which API i need for that or what are the steps i have to take for to fetch profile in JAVA.

Member Avatar for SasseMan
0
84
Member Avatar for Mehwish Shaikh

Hello All, I am having some troubles with my code, which is: [code] import java.net.*; import java.io.*; class TestInet { public static void main(String args[]) { try{ InetAddress inet = InetAddress.getByName("72.14.203.106"); InetAddress inet1 = InetAddress.getLocalHost(); InetAddress inet2[] = InetAddress.getAllByName("www.google.com"); //InetAddress inet3 = InetAddress.getHostName(); System.out.println ("Host of IP is[inet.getByName]: " + …

Member Avatar for maclord
0
366
Member Avatar for Pushpasheela

Here is my code. [CODE]import javax.swing.table.*; import javax.swing.*; import java.util.*; import java.awt.*; import java.awt.event.*; import java.awt.print.*; import java.awt.geom.*; import java.util.Calendar; public class Salary_report extends JFrame implements ActionListener { Vector data; JTable table; JLabel banner; ImageIcon images; Container c; Employee_report f1; JButton print; String s,days,basic,pf,hra,esi,bonus,advance,allowance,loan,incentive,dother,da,eother,gross,ded,net,leave; double ge,td,np,l,l1; public Salary_report(Employee_report f1) { …

Member Avatar for kramerd
0
135
Member Avatar for saisakthi

I am new to java, I need to save a image file from my system to my web application. How to do that in jsp or java? Need help urgently.....

Member Avatar for javaAddict
0
890

The End.