36,051 Topics

Member Avatar for
Member Avatar for javanew

[CODE] public class Node { int iData; double dData; Node leftChild; Node rightChild; public void displayNode(){ System.out.println(dData); } } [/CODE] [CODE]public class Tree { private Node root; //the root of the tree public Node find(int key) // find node with given key { // (assumes non-empty tree) Node current = …

Member Avatar for javanew
0
147
Member Avatar for gigimariah

I have just started taking Java as a course in college and I am having a problem understanding how to find the syntax errors in a definition for a class.I am not asking for answers I just need help understanding it more. The class is public class AA { private …

Member Avatar for javanew
0
93
Member Avatar for usccapo

Please help me this question is givin me so much stress. This program is for you to get familiar with file IOs in Java as well as writing methods. Write a program that asks the user for a file name that contains a line delimited records of student applications. Each …

Member Avatar for peter_budo
-1
135
Member Avatar for feoperro

Hi, Does anyone know where I can read about ways to protect a website from potential threats? i.e. SQL Injection, etc. In particular, a website using HTML/JSP/Servlets/Java/Tomcat. Thanks, Ashton.

Member Avatar for peter_budo
0
2K
Member Avatar for caro11

[COLOR="Red"]hey,i'm having trouble with this code...it keeps saying there is an error..can you help me please...thank you in advance[/COLOR] cannot find symbol symbol: constructor CompteBancaire() location: class javaapplication18.compteBancaire this is the class: [CODE] package javaapplication18; import javax.swing.*; import java.util.Scanner; public class CompteBancaire { private String nom,prenom,typecompte,currency; private int numerocompte; private …

Member Avatar for caro11
0
127
Member Avatar for khaled_jawaher

pls,i need help in inserting a date from a text field using java, to mssql database. i am getting incorrect date for example when i insert 13/3/2010,i am getting the date 1/3/2011.i want a solution,i've searched a lot but useless. the code is: [CODE] try{ java.util.Date d; String s; d …

Member Avatar for kramerd
0
2K
Member Avatar for wow.lk

I write some coding i want to get 2 output like Example (1) of object Employee:  Id#  Name :  Age:  Sex:  etc. Example (2) of object Employee:  Id#  Name :  Age:  Sex:  etc. i just dont want a long code.. …

Member Avatar for tenorsax08
0
157
Member Avatar for hatux

It might be quite newbie question but i've been through my books and searched online; yet still didn't find any answers. I have a couple of classes with methods in them. In my main : [CODE] public class main { public static void main(String fileslist[]) { new Folder(); Search SearchFiles …

Member Avatar for cale.macdonald
0
89
Member Avatar for FALL3N

If I already have a JListBox set up, but the text is too small, how do I make the font of the elements larger?

Member Avatar for fdevanand@gmail
0
219
Member Avatar for sajidshamshad
Member Avatar for vikas.kethineed

I have this method to see whether not the year is a leap year or not. heres the code i get the error missing return statement at the end. What can i do , i can't add return true or return false, becuase that screws it up. public boolean isLeapYear() …

Member Avatar for kramerd
0
228
Member Avatar for rayden150

i have been in a java course it´s kinda expensive but anyways i am thinking that im going to quit cause its not hard but its really overwhelming dont you get that feeling?, theres just to much to learn!, i cant believe people learned more than 1 programming language also …

Member Avatar for ceyesuma
0
161
Member Avatar for Nidhi S.

[CODE]import java.awt.*; import java.awt.event.*; import java.awt.image.*; import java.io.*; import java.sql.*; class MyCanvas extends Canvas { Image img; public MyCanvas(Image img) { this.img = img; } public void paint (Graphics g) { if (img != null) { g.drawImage(img, 0, 0, 1000, 1000, this); } } public void setImage (Image img) { …

Member Avatar for Nidhi S.
0
1K
Member Avatar for hateme_devon
Member Avatar for masijade
0
250
Member Avatar for girl.java

hi everyone this is my code. [CODE] public class Qustion3B{ public static void main (String args[]){ double sinx = Math.sin(0.5236); double cosx = Math.cos(0.5236); sinx = Math.pow(0.5236,2); cosx = Math.pow(0.5236,2); double sum=sinx+cosx; System.out.println("sine: " + sinx+"cosine: " + cosx +"sum: " + sum ); } }[/CODE] it continue to show …

Member Avatar for sharathg.satya
0
143
Member Avatar for jamesyrawr

Ok for my uni project im wondering if its possible to make a simple game where by the user must click a button ten times to win. the button has to move after every click to a random point on the screen. Does anyone know if there are any tutorials …

Member Avatar for sharathg.satya
0
137
Member Avatar for cassandracritch

If anyone could explain how to design an applet code for a simple house, then modify it. I wil give details if anyone can help.

Member Avatar for nihal_kiss
0
80
Member Avatar for solomon_13000

Can anyone explain to me in simple English language why we can't use assertion for: 1) Argument checking in public methods. [CODE] public class Test{ public void abc(int a){ assert a>3 } } [/CODE] 2) Command line arguments. [CODE] public class Test{ public static void main(String[] args) assert args.length==3 } …

Member Avatar for solomon_13000
0
91
Member Avatar for kkjava

Hi All, Iam really stuck with this issue.... I have HashMap values like these below [0.76,.0818] from DB i want to display these values in each <TD> in jsp. this is what am trying....... setting HashMap values in arraylist in DAO class and iterating that arraylist into <TD> of Html …

Member Avatar for peter_budo
0
95
Member Avatar for Dean_Grobler

Helooo, Attached is a pic of my main screen of my program. Basicly it's a phone book app similiar to one you'd have on your phone. The thing that I can't wrap my mind around, is that you see the nice big textArea there? After you've added a contact now. …

Member Avatar for masijade
0
175
Member Avatar for Sunshineserene

Hi, I am getting this error for my codes: Exception in thread "main" java.lang.NumberFormatException: For input string: "{ 1.0, 2.0, 3.0, 4.0, 5.0, 1.0, 2.0, 3.0, 4.0, 5.0, 1.0, 2.0, 3.0, 4.0, 5.0, 1.0, 2.0, 3.0, 4.0, 5.0, 1.0, 2.0, 3.0, 4.0, 5.0, 1.0, 2.0, 3.0, 4.0, 5.0}," at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224) …

Member Avatar for Sunshineserene
0
2K
Member Avatar for sirlink99

When I run this loading bar script the bar doesn't load and then it loads to the maximum. how come this load bar doesn't work thanks for the help. [code] // The "LoadBar" class. import java.awt.*; import hsa.Console; public class LoadBar { static Console c; // The output console public …

Member Avatar for sirlink99
0
166
Member Avatar for ASIWYFA

Hi, I have recently started Java in my course and I have been asked to write a program that finds the sum and average of 5 numbers. Its very close to working correctly but I cannot see where I am going wrong. Code: [CODE]import java.util.Scanner; public class average { static …

Member Avatar for ASIWYFA
0
427
Member Avatar for sirlink99

I have an error when I add in another ball. The colors are the same how would it be possible to change the colors of the balls seperately when they are on the same screen. When I added the other ball in when one hit the edge the second one …

Member Avatar for Ezzaral
0
210
Member Avatar for hatux

Hello there I am new to my coding career :) and have been facing a slight problem over here I want to read a folder\s files and have tried countless ways of accessing the directory but keep getting my code's error message. Please have a look and guide me if …

Member Avatar for hatux
0
150
Member Avatar for jemimaloh

Hey. I've got a programme that processes the files in a given directory. However, it can only run those files if the programme itself is saved in the same directory. The error i am experiencing now is that once my programme runs, it also generates a class file which also …

Member Avatar for jemimaloh
0
119
Member Avatar for TahoeSands

I love to play Poker and Blackjack online and I would like to duplicate how one of these casinos displays chips on the screen. We have all see this type of button before... An image of a $1 chip is shown at the bottom of the screen. As we mouse …

Member Avatar for kramerd
0
93
Member Avatar for noneta

hi all,, i really don`t know what its wrong in my code ,,, what i want its the user print the sentence and the program count eash sentence and devide it here is my code,,hope u help me :) [code]import javax.swing.*; public class tracing { public static void main(String args[]) …

Member Avatar for Ezzaral
0
130
Member Avatar for funlove201

hey can someone please help me with this thing? I wanna open a link when someone clicks on a button how can I do that?

Member Avatar for cale.macdonald
0
144
Member Avatar for jliao20

For the parser class, I need to use parseProgram() to take a filename as a parameter, opens and read the contents of the file, and returns an ArrayList of Statement objects. Since I am new to Java, I do not know where to start from. I also like to know …

Member Avatar for jon.kiparsky
0
160
Member Avatar for indrasmission

can any one please tell how to write a text editor program in java for running and compiling of any given program

Member Avatar for indrasmission
0
108
Member Avatar for Simes

This is an assignment I am working on for uni and I have done quite alot by myself and with some hints along the way from others who know Java better than I do. So I am working on a GUI Traffic Simulator (creating the GUI and drawing it is …

Member Avatar for Simes
0
181
Member Avatar for lilsmurf

No matter what I enter in for my amounts, it always tells me that the total is 13. Here is my code: [CODE] String input = ""; int month = 1; int year = 0; int total = 0; double average = 0.00; int inches = 0; int rainfall = …

Member Avatar for stultuske
0
84
Member Avatar for samehere

is there any surce code to display an image in a dialog box in java pls solve this.........

Member Avatar for masijade
0
152
Member Avatar for vasu.bavana

We want to use another java web application into our current java web application, how do we use iframe concept exactly in our java web application?

0
89
Member Avatar for bonett09

Hey guys, I'm working on an assignment which requires me to have one of my constructors to have parameters though I get an error in "Car c2 = new Car();" that it cannot find symbol. Also I am required to enter the necessary get and set methods to be able …

Member Avatar for kramerd
0
149
Member Avatar for incubus9x9

Ok so this code works great with an if else statement but i dont why when i change the showMenu to a switch statement you cannot see my print out statement as a menu!? Iv tried different ways of writing the print outs and they havent worked at all. Also …

Member Avatar for incubus9x9
0
143
Member Avatar for anshulbatla

hi i m the beiggner of java i wanna to learn the jdbc with sql ,suggest me the popular sites for it

Member Avatar for Ezzaral
0
32
Member Avatar for blknmld69

Good Morning, Having a problem with my program not calculating. I have wrote a program CashRegisterA Class that should be used with the RetailItem Class. The CashRegisterA Class should stimulate the sale of the retail item. It should have a constructor that accepts a RetailItem object as an argument. The …

Member Avatar for blknmld69
0
1K
Member Avatar for FallenPaladin

Hi there, I am having some syntax and logical implementation problems with a really very simple requirment and I am hopeing someone can help point me in the right direction. The problem I am having concrens trignometric functions in 3d space and what I am trying to do is find …

Member Avatar for FallenPaladin
0
192
Member Avatar for pareshverma91

my apologies for putting up this thread here, but couldn't find an apt section. I am beginner in java and would like to use netbeans as ide. I hava a few doubts regarding the ide. ---is it possible to write a single file of code, i mean, normally a whole …

Member Avatar for PatrixCR
0
116
Member Avatar for LianaN

Hi! I have a problem with the array of JTextField components. So, the code is shown below and it can be successfully compiled: [CODE] txtAdminTextFields = new JTextField[nrOfCols]; ... tableAttributes.getColumnModel().addColumnModelListener(new TableColumnModelListener() { public void columnMarginChanged(ChangeEvent e) { for (int i=0; i < nrOfColsFin; i++) { txtAdminTextFields[i] = new JTextField(); txtAdminTextFields[i].setPreferredSize(new …

Member Avatar for JamesCherrill
0
329
Member Avatar for praneil2050

hello, this is my 1st post.. i have created free sms service using html for my website. And now i want to make its java app for mobile phones. Following r the screens when app is started 1st screen: when app is launched, it should compulsory send message to certain …

Member Avatar for cale.macdonald
0
219
Member Avatar for sirlink99

[code] // The "ChoseYourOwnStory" class. import java.awt.*; import hsa.Console; public class ChoseYourOwnStory { static Console c; // The output console public static void main (String[] args) { c = new Console (); String start = ("yes"); // assignment 1 while (start.equals ("yes")) { c.println ("A high ranking thug comes walking …

Member Avatar for kramerd
0
111
Member Avatar for lilsmurf

When I try to run my program, it lets me enter in the beginning balance, interest rate, and number of months. However, when it hits the for loop, it completely skips over everything inside of it and prints out the amount that was entered for the starting balance. Can someone …

Member Avatar for cale.macdonald
0
90
Member Avatar for AaronLLF

I get an error in the Eclipse console when trying to run a first person camera using LWJGL & Java. "Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path" I did include the jar's for libraries and I did add the VM argument -Djava.library.path=C:\lwjgl-2.5\native\windows\ Please help.

Member Avatar for FallenPaladin
0
332
Member Avatar for joshianurag18

hi all i need urgent help.Thanks in advance. i have java code on windows and some files in unix server. I just want to read that file from unix server and apply my business logic. I have approch for that like first using FTP i will take a copy of …

Member Avatar for kramerd
0
136
Member Avatar for UncleJoe

I hope this hasn't been beaten to death...I looked through the forums and didn't find what I needed. I have a form where an input (textbox) Change event populates several other inputs within the form via ajax...everything works famously when I comment out the Form::open('edit_product'), Form::button('submit', 'Save Product'),and Form::close() in …

Member Avatar for UncleJoe
0
215
Member Avatar for XxPKMNxX

Being a noob, such a simple question i answered as soon as i posted :| - delete thread please.

Member Avatar for XxPKMNxX
0
98
Member Avatar for Christ90

Hi, i want to try to make a program that reads from file and shows the frequency of the words in that file. I want to sort the frequency of the words acsending. But this i want done after it has been read from the file using a Comparator. Anyone …

Member Avatar for kramerd
0
133

The End.