35,619 Topics

Member Avatar for
Member Avatar for Alpdog14

I was wondering if someone can help me with how to convert my code so that it converts the cents to dollars and also round to the nearest cent: [CODE]public class Subscription { private int price; private int length; public Subscription(int p, int n) { price = p; length = …

Member Avatar for BestJewSinceJC
0
11K
Member Avatar for mamameanslove

I'm currently taking Java I and I have to write a program that reads 5 integers and determines and prints the largest and smallest numbers without using an array. I have to only use the if statements. I can't figure out how to make the if statement apply to 5 …

Member Avatar for BestJewSinceJC
0
2K
Member Avatar for jemz

hello please help me on this i make a simple program that inputs the first name and family name and age, and this will display to the table ...can you help me how to delete the save data on my JTable the one that i inputed ...thanks in advance hoping …

Member Avatar for jemz
0
34
Member Avatar for jemz

hello can you help me please... i have a button print and i dont know how to make the code that will print all my data in my database....please help me how to make this print code ..hoping for your positive responds.

Member Avatar for thomas_naveen
0
119
Member Avatar for mamameanslove

I have written my program to prompt the user to enter an integers and then print if the number is odd or even. It says build successful, but will not prompt for the information to be entered and print the data. I use Netbeans with the JDK bundle. Please help. …

Member Avatar for BestJewSinceJC
0
121
Member Avatar for feoperro

Hi, I have pasted my code below, please paste it into a JSP and tell me why it gives the error "Unterminated String Constant" [CODE] <html> <head> <title>Debugging</title> <script language="javascript"> function changeOn(object, objectId) { alert('in function'); if (object == 'bookingsButton') { alert('first if'); document.getElementById(objectId).src = 'Images/BookingsOn.png'; } else if (object …

Member Avatar for feoperro
0
205
Member Avatar for feoperro

Hi, I know there is an XML/Xpath topic already, but how about a SOA topic? Users can then post questions on Oracle SOA, Netbeans SOA, etc... Thanks, -Ashton.

Member Avatar for ~s.o.s~
0
105
Member Avatar for kendaop

Hello all! I thought I was finally getting good at this "Java" thing, and then someone suggests to me that I use a singleton and factory class. I'd never heard of these before so I set off googling it. Now, I get the gist of singleton and factory classes, but …

Member Avatar for JamesCherrill
0
155
Member Avatar for gunjannigam

I am using Ubuntu 9.04. I want to shutdown my PC using Java, when some Event is called. Please suggest what could be done.

Member Avatar for gunjannigam
0
105
Member Avatar for ElieM

from the search I made I understood that I must declare the class in a package then put it in WEB-INF/classes. and call it from the jsp page. SO. my class is: package x.com; import java.io.*; [code]public class X { public static void main(String[] args ) throws IOException { File …

Member Avatar for javaAddict
0
664
Member Avatar for purushoth123

kindly please tell me how to connect from java to ms access, sql,oracle and so etc . with example

Member Avatar for peter_budo
0
173
Member Avatar for Snowdiddy

Hello to all my fellow IT people! I have two questions! I would like to start learning how to program! Is Java a good beginners language to start with and if it is not what is a good language? My second question is if Java is a good language then …

Member Avatar for wee_shark
0
122
Member Avatar for bkafroboy69

public double getThirdSide() If the triangle is not valid, this should return 0. Otherwise it should return the length of the third side of the triangle. i cant figure out how to put this into coding any help thanks [CODE]public class Triangle { //PART 1 // a triangle is defined …

Member Avatar for darkagn
0
100
Member Avatar for wee_shark

Hi all, I'm new to java applets. This is basically my first bigger applet. It works 100% fine when I run it in the applet viewer. As soon I start it in a web browser it stops working half way through. The code below is a short version of my …

Member Avatar for wee_shark
0
97
Member Avatar for dubdub

So I am working on storing inorder traversal indices associated with every node in a BST (So if I add BAC, then the inorder index of A = 0, B = 1, C =2). The thing is that whenever you add a new node to a BST, you must recompute …

0
46
Member Avatar for dalymiddleboro

/** * Simple math application using a scanner input * @version 1.00 2010/1/26 */ import java.util.*; import java.text.*; import java.io.*; public class mathopr { public static void main(String[] args) { double num1,answer1,answer2,answer3=0; String myname; String reply; char replyChar=; Scanner input = new Scanner(System.in); DecimalFormat df= new DecimalFormat("00.00"); while (replyChar=='y'){ System.out.println("Please …

Member Avatar for AndreiDMS
0
87
Member Avatar for doha786

hi, i m facing a small prob in GUI, need to save my output to a particular folder. below this code showing the square of any integer in TextField named: "resultField". i've a button "save" that need to save the result from that TextField, suppose in my "c:\Repository " folder …

Member Avatar for BestJewSinceJC
0
156
Member Avatar for dubdub

Is there a simple way to find and store the depth of every node in a BST using recursion? I can't seem to figure out a straightforward way of doing so.

Member Avatar for BestJewSinceJC
0
102
Member Avatar for youngwolf0

I'm fairley new to programming in general being a fresh IT graduate. Some software I am developing needs to be able to compress a folder in to a .zip file and later extract it while maintaining its file structure. I am able to do this but extracting the file takes …

Member Avatar for ~s.o.s~
0
186
Member Avatar for chern4ever

[CODE]import javax.swing.JOptionPane; public class test{ public static void main(String args[]){ String numT = JOptionPane.showInputDialog(null,"Please enter a value."); double num1 = Double.parseDouble(numT); System.out.println("Fahrenheite = "+num1+"\nCelcius = "+convertFtoC( num1 )); } public static double convertFtoC ( double num1 ){ return ((5/9)*(num1-32)); } }[/CODE] why the value return is zero? hrm... can anyone …

Member Avatar for fardoonmuhafiz
0
177
Member Avatar for billybobc

Hello, When I add a simple <c:set var="foo" value="bar"/> line to my jsp I get the following error: javax.servlet.ServletException: javax/el/ELException org.apache.jasper.servlet.JspServlet.service(JspServlet.java:273) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) root cause java.lang.NoClassDefFoundError: javax/el/ELException java.lang.Class.getDeclaredMethods0(Native Method) java.lang.Class.privateGetDeclaredMethods(Unknown Source) java.lang.Class.getDeclaredMethods(Unknown Source) java.beans.Introspector$1.run(Unknown Source) java.security.AccessController.doPrivileged(Native Method) java.beans.Introspector.getPublicDeclaredMethods(Unknown Source) java.beans.Introspector.getTargetMethodInfo(Unknown Source) java.beans.Introspector.getBeanInfo(Unknown Source) java.beans.Introspector.getBeanInfo(Unknown Source) java.beans.Introspector.getBeanInfo(Unknown Source) java.beans.Introspector.<init>(Unknown Source) java.beans.Introspector.getBeanInfo(Unknown Source) …

Member Avatar for heathersh
0
2K
Member Avatar for guravharsha

Hi everyone I have one we application developed using java,servlet and jsp. i am running it using Apache tomcat server 5.5. When i am running it on my local machine, i am given path as [B][url]http://localhost:8080/student/[/url][/B] where as student is name of application. Now if i require run same application …

Member Avatar for jwenting
0
113
Member Avatar for youngwolf0

I'm fairley new to programming in general being a fresh IT graduate. Some software I am developing needs to be able to compress a folder in to a .zip file and later extract it while maintaining its file structure. I am able to do this but extracting the file takes …

Member Avatar for youngwolf0
0
159
Member Avatar for Stefano Mtangoo

This is not seek for IDE thread but rather want just to know your beloved IDE. For Me, up to recently I used Eclipse but now I'm trying IntelliJ Idea community. Not very used to it but looks promising. What about you friend?

Member Avatar for jwenting
0
151
Member Avatar for indu_ss4

Hi Im a newbie of jsp and Im developing a project in jsp. I want a text box that display data from database in the same place when i click a link.all the links are available in a table. Any help appreciated... Thanks in advance, Indu.

Member Avatar for indu_ss4
0
201
Member Avatar for feoperro

Hi, I would like to know if it's possible to have a web application that processes data like this: 1. Submit form data in a JSP, using the: action="myServlet". 2. In the myServlet code, we process the requests and responses and add what we need to add into sessions. 3. …

Member Avatar for feoperro
0
101
Member Avatar for geoffy0404

Hello, i have a few questions regarding - writing software and using that software in my cell phone. -Which language is best for cell phone software? - Can i use java, and would that be the easiest? -where do i even start when i begin to write a cell phone …

Member Avatar for siva08811a1253
0
152
Member Avatar for basketball4567

I need to be able to choose one of the three boxes and have then drag around the screen, i can only get 1 of them, kinda of. I want to be able to drag the red one, or the green. I can kinda get the green to drag but …

0
92
Member Avatar for NPP83

Are objects that are instantiated from their respective class done so within the code of the class itself (as in on the same document (Class.java) or are they created from the code in main method of the program (Main.java). More questions to build on this... Thanks ahead of time! -Isaiah …

Member Avatar for BestJewSinceJC
0
50
Member Avatar for Loved

[code=Java] /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package paint1; import java.awt.event.*; import java.awt.*; import javax.swing.*; import java.awt.image.*; /** * * @author Jeanine */ public class MyPanel extends JPanel { private int startX, startY, endX, endY; public int …

0
37
Member Avatar for AnnaBaker

I am new to Java and have a class assignment that I need help with.. The assignment is to write a program that computes the tax and tip for a restaurant bill. User is to enter the total amount of the bill. Tax is 6.75% of the bill. The tip …

Member Avatar for Ludachrispeed
0
3K
Member Avatar for pucivogel

i am creating a program for hotel management,i want to get the source from JButton and JCheckBox at the same time,how do i do with actionListener? [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; public class HotelManagementGUI extends JFrame implements ActionListener {static final String[] rommcouplesea={"1","2","3","4","5","6","7","8","9","10"}; static final String[] roomcoupleroad={"1","2","3","4","5","6","7","8","9","10"}; static final …

Member Avatar for AndreiDMS
0
87
Member Avatar for lalit_jain1988

i am new in jsp...Can any one help me that how i can upload image in database using one html form and jsp code..........

Member Avatar for peter_budo
0
44
Member Avatar for selenask

Hello could someone please help me as my program is generating some weird error" java.lang.IllegalArgumentException: adding a window to a container" Could someone please look at it and tell me what I'm doing wrong. Im trying to add an object of fan to the panel it creates that error. whenever …

Member Avatar for KirkPatrick
0
167
Member Avatar for KirkPatrick

I have created a function that is supposed to go through a text file (csv) and read the information in it and then add it do a dataobject (which just holds the info in textfields and a combobox) which when filled adds itself to the jpanel. The issue I am …

Member Avatar for KirkPatrick
0
137
Member Avatar for jemz

hello can you help me on this i have gel compiler then i want to debug my program but the debug button is not highlighted then it can't be click...ahm can you help me on this or please suggest me if what is the best compiler for java?...thanks in advance …

Member Avatar for jemz
0
104
Member Avatar for karthickparthi

[code]import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.net.ServerSocket; import java.net.Socket; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JProgressBar; import javax.swing.JScrollPane; import javax.swing.JTextArea; …

Member Avatar for JamesCherrill
0
95
Member Avatar for kgkamaraj

i am doing project in java.... can any one suggest how to write code for mathematical regression in java.. .or did any one have code for that...... any website is there to learn for mathematical regression...

0
55
Member Avatar for jamojo

Hello everyone, I am using the code below. It is working when I used this in Eclipse. What I did is to place the generated keystore from the InstallCert.class ([url]http://blogs.sun.com/andreas/resource/InstallCert.java[/url]) to the latest JRE in the Program Files>Java But when I deployed this class in the Tomcat/Bea its searching I …

Member Avatar for xiaocong
0
445
Member Avatar for mseck

iam currently on a program that reads two integers values, with the second has to be a non-zero integer. here is my codes so far: Does it look ok ? PLEASE HELP !:( [CODE]public class Lab2App { public static void main(String[] args) { // Calculate 5 and 3 with relation …

Member Avatar for javaAddict
0
162
Member Avatar for bharri

the application below is what i did so far, please give me feedback the Payroll Program so that it uses a class to store and retrieve the employee's name, the hourly rate, and the number of hours worked. Use a constructor to initialize the employee information, and a method within …

Member Avatar for verruckt24
0
93
Member Avatar for rwildman23

The following lab was originally assigned but skipped over because we were off for MLK day. I would still like to do it but am just not following what I should be doing. Help? In this lab you are going to extend the code you wrote in you first lab. …

Member Avatar for musthafa.aj
0
125
Member Avatar for bloodreign39

I am having some problems with my java code, i am trying to write a C compiler and am currently working on developing a string tokenizer for the C programming language using java regex. my problem is first my program wont recognize multiline comments and second i cant figure out …

Member Avatar for musthafa.aj
0
202
Member Avatar for DavsTaylor

This is probably a stupid mistake but I can't see the issue, it's with the if statement at the bottom: [code=java] /** * Write a description of class Order here. * * @author David Taylor * @version 1.0 */ import javax.swing.*; import java.text.DecimalFormat; public class Client { // instance variables …

Member Avatar for AndreiDMS
0
145
Member Avatar for conspiracy_dawg

I've been having problems with the now deprecated mouseDown and mouseDrag methods, I know the deprecation causes no problem, the program runs fine, but for grading purposes I want my program to be error and warning free, is there any EASY alternative that can solve this deprecation method? I know …

Member Avatar for PersonalIT
0
476
Member Avatar for severman
Member Avatar for AndreiDMS
-1
115
Member Avatar for severman

hi does any 1 can show me a simple code how to show a picture on a j2me cellphone? what i want to do is: i have a tcp server based on j2se. i want it to send a png/jpg to a cell phone via the socket and then show …

Member Avatar for peter_budo
0
109
Member Avatar for Janes

Hi, I would need help, pleas. I would like to portray the curve under the specified angles with the repeat and the number of segments. Will you help me please? now I have this: [code] import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Graphics; import java.awt.HeadlessException; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import …

Member Avatar for adams161
0
116
Member Avatar for adams161

I have a java applet and i'm letting the user open a chess engine on their computer. Technically they can open any program now. but it wont work unless its a chess engine that uses the winboard protocol. My question is could they maliciously choose to open any sort of …

0
87
Member Avatar for Shmoil

Forgive me I am still really new to Java. I have this swing application which creates a small JFrame that when clicked, counts down from 2 minutes and stops at zero. I build a GUI in netbeans IDE and I read that in order to place this timer code into …

Member Avatar for Shmoil
0
303

The End.