36,051 Topics

Member Avatar for
Member Avatar for kahaj

For some reason, line 67 is saying, "variable ddOption may not have been initialized. However, on lines 80 & 93, that variable is used and works just fine. Any idea of what's wrong here? (I omitted some of the code in the middle section. [code] //ShapeCalculator.java import java.util.Scanner; public class …

Member Avatar for kahaj
0
119
Member Avatar for sweebez

Hello! I'm having a bit of confusion here regarding toStrings and Constructors. Namely, why would you ever need them? I have a project for my course, and in it, I use a method that checks for a creature's "energyLevel" to see if that creature is still "alive". This method returns …

Member Avatar for 0805638
0
637
Member Avatar for llemes4011

Hello everyone =) I'm a Java programmer who wants to do work with databases. MySQL seems to be a popular choice, but I don't know where to start. I messed around with Derby, but I didn't really understand what was going on. If anyone could point me in the direction …

Member Avatar for peter_budo
0
122
Member Avatar for abhi_marichi

How the JAVA compiler was developed????? What language and compiler they used to develop it.... and what factors made it platform independent.... If I want to write a language and a compiler and make it platform independent how can I do it....... Please help me out with answers........ Please......Please

Member Avatar for 0805638
-1
111
Member Avatar for 0805638

I use the IDE Netbeans and as a personal project I want to create an application in java similar to "Mac OSX" dock bar. I dont know how to run the coding using the GUI...all I have done so far are database structures and commandline programming. I will need to …

0
64
Member Avatar for valleymorning

Dear all, I have been told there is something wrong with the following code. Could someone please shed a light on this, I'd be greatly thankful to your help. VM ---------------------------------------------------- [code] Identify the problem in the following code: // Retry three times on failure to open file. int retryCount …

Member Avatar for masijade
-1
85
Member Avatar for carl9999

There's an error regarding the scanner and i'm honestly not sure how to make it work i'm using javac as a compiler, please help me solve this issue, ive been trying for hours [code]import java.util.*; public class testing { public static void main(String[] args) { String forename; String surname; String …

Member Avatar for carl9999
0
100
Member Avatar for whiteyoh

Hi all, im very new to java i would like to know how to add the following objects into an array [code] CD cd1 = new CD("Kaiser "," up the khazi ", 9.99); CD cd2 = new CD("Oasis "," morning glory ",3.99); CD cd3 = new CD("Bob Dylan "," Alreet …

Member Avatar for Ezzaral
1
493
Member Avatar for kat1

I am using java.io package in my j2me programe in order to use PrintWriter but package does not show PrintWriter option nor it shows BufferedReader option , why this happen ??i do not know.if any one knows the solution plz tell me.is it require any specific library???? plz help me …

Member Avatar for sincerelibran
0
112
Member Avatar for Teethous

[TEX]Hey everyone, I am having a problem with converting my character array. The program runs, but in the display box I get little squares instead of a string. The program should display the first char of the fist name, the first five of the second name and a random number …

Member Avatar for Teethous
0
181
Member Avatar for manish27896

Hi , I need one help. For one of my project requirement, I need to extract contents of RPM package and I have to write Java program for the same. Do anybody have any idea how to do that. Drop me a mail at [email]manish27896@gmail.com[/email] if anybody knows solution for …

Member Avatar for masijade
0
38
Member Avatar for guilh_22

Hi everybody, I need some help with my first Java program. My teacher don't teach really good ... I have a problem to solve in my script. At that time all are okay but all number must be rounding to 2 decimal :S That's all my Java program (He is …

Member Avatar for javaAddict
0
135
Member Avatar for devidayalan

Hello, i need to create a webservices from the wsdl file using jaxws.Can anyone tell me how to do this in netbeans.it will be helpful if you explain me the helloworld sample in this regard. Providing the link for any article or tutorial is also welcome.Kindly help am new to …

Member Avatar for pooja.ui7
0
421
Member Avatar for keekee

My code runs fine, but I keep getting this error message: I would like to change this logo from a paperclip logo to a book logo, my code is under the error. Can you tell me what's wrong and how to change it to a book logo? Uncaught error fetching …

Member Avatar for masijade
0
95
Member Avatar for ssdharan03

I'm doing my college project on SAN Monitoring.. As a first phase, I've been asked to get my harddisk's free space and total memory in java using a tool called WBEM Services.. Can someone help me out in carrying out this task??

0
37
Member Avatar for kahaj

How would I draw a shape in an applet and have the border one color with the fill a different color?

Member Avatar for kahaj
0
84
Member Avatar for gunjannigam

I needed to draw an image and paint a needle on it. Since my image is stationary(it doesnt change) I dont want to paint it each time I call repaint. Thats why I thought of using JLabel with an Icon image. The problem is I cant paint anything on top …

Member Avatar for gunjannigam
0
257
Member Avatar for javanub123

i know how to draw 2D shapes just fine but how would i draw 3D ones? if thats even possible. please help, thanks =)

Member Avatar for Ezzaral
0
71
Member Avatar for TaP1227

This program provides the user with options of what kinds of passwords they want, then they can choose from those menu options, then enter how long they want their password to be. The program is supposed to generate random ASCII values for the password(what it is composed of is based …

Member Avatar for TaP1227
1
134
Member Avatar for nagatron

Hallo to all, I need help on how to put a radio button on the coordinates I want. . .I have this map program and I want to place the radio button on the specified place on the map. I don't know how. . .I have attached an image of …

Member Avatar for nagatron
0
198
Member Avatar for EddieC

Urbancode today unveiled AnthillPro 3.7, the latest version of its build and deployment automation tool that piles seven popular source code analysis tools onto its [url=http://www.anthillpro.com/html/products/anthillpro/tool-integrations.html]list of third-party integrations[/URL]. There's also support for the GIT repository and DB2 and PostgreSQL databases, the company said today in a statement. Anthill Pro …

0
337
Member Avatar for MMD88

This one I almost have figured out (I believe). it is a program that takes a String in the main class and calls on a method to count the vowels inside the String. I then have to count each vowel (a,e,i,o,u) and input the total number of vowels (separately) into …

Member Avatar for MMD88
0
738
Member Avatar for llemes4011

Hi everyone. I know that asking for project ideas is generally frowned upon, but I wish to ask anyways. This isn't for school, it's just because I want to. I want to start writing applications that would be used in a business or workplace environment. I don't have a lot …

Member Avatar for llemes4011
0
245
Member Avatar for timon_zed

Kindly go through the code below and the little explanation that follows thereafter... The code for the web form [CODE]<form name="purchase" action="Purchase" method="POST"> <table border="1"> <thead> <tr> <th></th> <th></th> </tr> </thead> <tbody> <tr> <td>Product Number</td> <td><input type="text" name="ProdNum" value="" maxlength="7" /></td> </tr> <tr> <td>Quantity</td> <td><input type="text" name="quantity" value="" /></td> </tr> …

0
60
Member Avatar for whiteyoh

Hi All, I have an array of 3 objects stored in cdList. Because I have now added them to an array, the usual method of displaying no longer works: [code]System.out.println(cd1.getArtist() + " " + cd1.getTitle() + " " + cd1.getCost());[/code] My questions are...... how would i amend to output the …

Member Avatar for whiteyoh
0
82
Member Avatar for whiteyoh

Hi, Im fairly new to java and im working my way through a load of exercises and im a little bit stuck on something. I have two classes, one of which holds the main, which creates 3 objects. I would like to know how to how to count the total …

Member Avatar for whiteyoh
0
287
Member Avatar for BestJewSinceJC

It took me very little effort to put a JComboBox in a JTable so that when the cells in a certain column are clicked, it lets the user choose from a drop down list of items. However, my program requires that the underlying combo box can change, since the list …

Member Avatar for BestJewSinceJC
0
2K
Member Avatar for theo19

[CODE] import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Calc extends JFrame implements ActionListener{ JFrame frame; JPanel textfield1,textfield2,rowpanel,calcb,mainpanel; JTextField display; JButton[] b; public Calc(){ frame=new JFrame("Calculator"); textfield1=new JPanel(); textfield2=new JPanel(); display = new JTextField(16); mainpanel = new JPanel(); textfield1.setLayout(new GridLayout(4,6)); textfield1.add(display); textfield2.add(textfield1); //array String[] cbuttons = {"7","8", "9","/", "4", "5", …

Member Avatar for BestJewSinceJC
2
191
Member Avatar for Xessa

I have a Servlet and JSP page. I invoke a method with form submit and the method is a java method. [code] response.setHeader("Content-Disposition", "attachment; filename = report.XLS"); response.setContentType("application/vnd.ms-excel"); response.getWriter().write(result); response.getWriter().flush(); [/code] Everything works fine but it tries to fit the columns in 1 page. So i have a long adress …

Member Avatar for ~s.o.s~
0
81
Member Avatar for Stefano Mtangoo

Hi All, I'm starting learning Java and I need online tutorial. I have benefited a lot from site [url]www.zetcode.com[/url] and I would like to have summarized and "well-for-beginner" tutorial. Many of Java tutorials I find are a bit confusing to newbie like me. I'm not new to programming (a lot …

Member Avatar for Ezzaral
-3
117
Member Avatar for whiteyoh

Hi all, I would like to know what to add to the following code to count the number of objects that have been created. [code] class CDDriver { public static void main(String args[]) { CD cd1 = new CD("Kaiser "," up the khazi ",(double) 9.99); CD cd2 = new CD("Oasis …

Member Avatar for VernonDozier
-1
101
Member Avatar for MMD88

Hello! This is my first post and I am a beginner in Java programming-so don't come down on me too hard :) I have a problem that I need to solve over the weekend and I was hoping some of you could help me out. The problem at hand is …

Member Avatar for quuba
0
122
Member Avatar for jrosh

My database table need to insert a time value in the format of hh:mm:ss ... As the input source I use JTextbox. it returns me a String. (after using .toString()) I want to convert into the type of Time(hh:mm:ss) in order to store it in my database... How can I …

Member Avatar for javaAddict
0
77
Member Avatar for jrosh

I want to have a date picker for my application. It should be really simple... I went through many examples. But all I found contains very large files (LOCs)....How can I impliment a simple calender? to pick a date and time.... (jst wanna use them in two comboboxes... to pick …

Member Avatar for javaAddict
0
88
Member Avatar for adityam4444

I have a struts 1.x application which uses JDK 1.4. I want to implement YUI Compressor in this. What can be the best ways to do that? Step wise instruction will be very helpful. Thanks.

0
46
Member Avatar for Sweet_person4

I am looking for java syntax to read an attached *.txt file which contains 3 html source code files separated by the file id as follows .IIIII 1, .IIIII 2, .IIIII 3. any help to get me started. I know how to read the who file but I am stuck …

Member Avatar for masijade
-1
33
Member Avatar for KimJack

Hi All, Is it possible to convert an arraylist of chars to an array? For example: ArrayList<Character> array = new ArrayList<Character>(); Can this be converted to an array of chars. I have tried using the toArray method but it is not working. Does anyone have any suggestions? Thanks, Kimjack

Member Avatar for BestJewSinceJC
0
230
Member Avatar for thisisnot232

I wrote this code for a small project, and I am probably declaring a method in a method, because I keep getting "illegal start of an expression." This is happening at line 27, and 43. I am fairly new to java, so please don't be to harsh. I might have …

Member Avatar for VernonDozier
0
100
Member Avatar for kahaj

I just finished this project, thought I had it done, but on line 1, it's telling me, "incorrect Package". What am I missing here? [code] import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.io.*; public class JavaNotepad extends JFrame implements ActionListener, KeyListener { boolean txtChanged = false; String fname = ""; …

Member Avatar for llemes4011
0
204
Member Avatar for Bloubul

Please help me with this assignment as well, because I am receiving a error when Running the application. The error I am receiving is: Exception in thread "main" java.lang.Error: Do not use Stock.setLayout() use Sto ck.getContentPane().setLayout() instead at javax.swing.JFrame.createRootPaneException(JFrame.java:458) at javax.swing.JFrame.setLayout(JFrame.java:524) at Stock.<init>(Stock.java:50) at Stock.main(Stock.java:36) Press any key to continue …

Member Avatar for JamesCherrill
0
186
Member Avatar for KAUL

//This program will calculate the compound interest. import java.io.*; import java.text.*; public class Program08 { public static void main (String args[]) throws java.io.IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); DecimalFormat roundMyDecimal=new DecimalFormat("0.00"); float amount; float principal; float interest; float compounds; float years; System.out.print("Enter the principal: "); // inputs principal. …

Member Avatar for KAUL
0
121
Member Avatar for Samyx

[code]class Complex { double real, img; void setValue(double i, double x){ real=i; img=x; } public double getRealPart(){ double a=real; return a; } public double getImagPart(){ double b=img; return b; } public double getMagnitude(){ double magn=Math.sqrt(real*real+img*img); return magn; } public Complex add(Complex c){ return new Complex(real+c.real, img+c.img); } public Complex multiply(Complex …

Member Avatar for Samyx
0
110
Member Avatar for mhil_joy

hello guys.. please help me! for my defense i need a system using java any system. i don't have any idea. please please help me.. or any program.. or please give me some ideas.. thank you alot..

Member Avatar for javaAddict
0
85
Member Avatar for JimD C++ Newb

Good evening! I'm working on an assignment, and I'm not seeing what is wrong with my logic here. Any assistance would be greatly appreciated. It's a basic appointment book, and if there is an appointment at the current time, I would like the "New Appointment" button disabled. However, if I …

Member Avatar for javaAddict
0
95
Member Avatar for Bloubul

I must write a interface to enter course information for transfer students. The created data file should be sequential in nature, with the student's name, his/her ID number, the course number from the previous college, and the accepted course number at the current college. The code I wrote so far …

Member Avatar for javaAddict
0
267
Member Avatar for whiteyoh

Hi all, Im fairly new to java and any assistance would be appreciated. The following should output string values, but if i use text within the creation of the new CD object i get an error, unless i change the content to numbers. I know the driver class is fine, …

Member Avatar for whiteyoh
0
111
Member Avatar for KimJack

Hi, This is a very simple question. Is it possible to print a one dimensional array into the shape of a grid? For example if I have the follow array: chars arrayofChars[] = {'A', 'B', 'C', 'D', 'E'...}; how can it be printed out as A B C D E …

Member Avatar for anupam_smart
0
167
Member Avatar for chinu

please let me know something abt how to go for making of on line examination project using jsp and beans as soon as possible

Member Avatar for peter_budo
4
215
Member Avatar for gibson.nathan

alright here are my instructions: [QUOTE]Display a menu giving the user a choice of character sets to use to construct the password. (Note: Do not use the first range of punctuation symbols with ASCII values from 33--47). 4. Allow the user to select the number of characters in the password …

Member Avatar for VernonDozier
2
1K
Member Avatar for armyofone83

I am having trouble getting my program to work I keep getting an error that says class, interface, or enum expected. What am i doing wrong?? Please help. [code] //Product.Java //Inventory program { // main method begins execution of Java application public static void main (String args[]) { public class …

Member Avatar for peter_budo
-1
168

The End.