32,199 Topics

Member Avatar for
Member Avatar for polarbear125

I've tried to define result many different ways, but I just can't get it to work. I know it's just something simple I am missing, but what is it? Can someone point me in the right direction? It currently says 'variable result might not have been initialized'.. but if I …

Member Avatar for DavidKroukamp
0
201
Member Avatar for shaswat.j

I have made a program in BlueJ using several attributes such as Arrays, Strings etc. I want to know a way in which I can execute this program in any Windows based application or any other platform than BlueJ so that it can be used by people. Any ideas?

Member Avatar for NormR1
0
85
Member Avatar for NoUserNameHere

Why doesn't it display the output for mouseReleased and mouseClicked in console? Is there something that I am missing? import java.applet.*; import java.awt.*; import java.awt.event.*; public class MouseMotion extends Applet implements MouseMotionListener{ public void init() { addMouseMotionListener(this); } public void mouseDragged(MouseEvent e) { System.out.println("mouse is being dragged at location (" …

Member Avatar for NormR1
0
282
Member Avatar for Mbot

Im trying to make a highlighter that will highlight a word after I have typed it in a JTextArea. The problem I have, is that after I press space, the highlighter doesnt stop. It continues highlighting the next words as well. public class highLighter { JTextArea ref; Highlighter hilite; String …

Member Avatar for Mbot
0
285
Member Avatar for Kert

Hey, I have a problem that I've been messing with for several hours, but with no result. I have a basic textfield where I can enter some info and I have to be able to read it and save it to a static variable by both pressing "Enter" and clicking …

Member Avatar for Kert
0
156
Member Avatar for nyfan68

I have an assignment which is two parts. The first part I have solved. It calls for me to write a program that can read an XML file which then creates a purse a purse object and then prints the total value of the coins in the purse. The second …

Member Avatar for nyfan68
0
325
Member Avatar for andy8521

Hi I am starting to learn Java. I am new to Java. Which book do you think is the best book to learn Java for Beginners?

Member Avatar for Krokcy
0
266
Member Avatar for joankim

Hey there. I'm trying to raise a longs to the second power, but as you might know, Math.pow takes two doubles, and also returns a double. Efficiency is kind of important, but it is more important to have this working. Do you know how I might go about solving this? …

Member Avatar for NormR1
0
2K
Member Avatar for bam010893

import java.util.Arrays; public class Names2 { public static void main(String[] args) { while (!StdIn.isEmpty()){ String choice = StdIn.readString(); String[] myStrArray = new String[] {choice}; //SORTS STRING ARRAY INTO CASE & THEN ALPHABETICAL ORDER Arrays.sort(myStrArray); //for loop to print int values to console for (int a = 0; a < myStrArray.length; …

Member Avatar for NormR1
0
202
Member Avatar for sara_magdy

hi i want to insert image in jtable using netbeans i wrote this code but it just disply the image name many thanks ImageIcon true1 = new ImageIcon("true.gif"); ImageIcon false1 = new ImageIcon("false.gif"); String data[][] = {{"", "", ""}}; String col[] = {"Index", "Specification", "Check"}; DefaultTableModel model = new DefaultTableModel(data, …

Member Avatar for DavidKroukamp
0
131
Member Avatar for maverick420

> I'm implementation polymorphism and have one confusing that if I use instanceof then I'm trying to perform casting which voids polymorphism so will that be any way to avoid instanceof with the code and still have the program working? Block of code where I have used instanceof starts from …

Member Avatar for maverick420
0
209
Member Avatar for thesmile

i want code for NotePad in java language ^_^ plz help me its Mark by 25 plzzzz

Member Avatar for DavidKroukamp
-1
101
Member Avatar for v3ga

I have a JLabel and a JPanel which both implements MouseClicked methods and I have added the JLabel to the JPanel but when the JLabel is clicked, the MouseClicked method of JPanel is invoked. How to fix this>??

Member Avatar for v3ga
0
156
Member Avatar for dhija22

Hi Im am bigginer in java and i want to know :If a,b are variables of integer type and S1,S2 are variables of Student,what does mean a=b, si=s2. Is any change in way how the value pass in these examples?? I am waiting for a response best regards Eda

Member Avatar for ash.28.88
0
125
Member Avatar for sadzee

**Hey, Hi all! I'm a bachelor student, new to Java. Following code is giving error in PrintDetails() What parameters should I define in it?? Kindly check and tag out my mistakes in the following code.. Thanks ^_**^ class student { String a;String b;char c;double d; student(String name,String rollno,char gender,double gpa) …

Member Avatar for ash.28.88
0
190
Member Avatar for OldDeveloper01

I have this printed "ljava.lang.string;@40585b18" instead of a vlaue from the string array called answers. At the moment i am not pick really as to what is pritned out. Just get the app to display something meaningfull from the array will be a good place to start right now. The …

Member Avatar for peter_budo
0
134
Member Avatar for Samama

provide a set of PC-based tools and utilities to organize historical performance data from an OpenVMS system. Purpose of System Synopsis To capture and maintain a history of variables directly affecting the performance of the VMS production systems. Then provide a graphic interpretation of that data to allow for trending …

Member Avatar for stultuske
0
110
Member Avatar for JerBear24

What I'm supposed to do: Rewrite the class below, so that it throws appropriate exceptions instead of returning -1 as an error code. Write test code that attempts to withdraw and deposit invalid amounts and catches the exceptions that are thrown. Original code: class Account { private double balance; public …

Member Avatar for DavidKroukamp
0
380
Member Avatar for Zaad

Hi techies got a small problem a swin related one... I found a similar article here [Click Here](http://www.daniweb.com/software-development/java/threads/89427/how-to-programatically-select-a-cell-in-a-jtree) But seems no answer for that in that particular thread in this forum. Since that is a very old thread thought it would be right to put in my question as a …

1
62
Member Avatar for blake81

Need help with just a couple of minor errors. for the lab I am currently doing I have 2 service/class (no clients or application classes). these are my errors Car2.java:138: error: not a statement Cars D = (Car2) car ^ Car2.java:138: error: ';' expected Cars D = (Car2) car Can …

Member Avatar for zeroliken
0
182
Member Avatar for simplyflawless

The class contains: - Two double data fields named width and height that specify the width and height of the rectangle. The default values are 1 for both width and height. - A string data field named color that specifies the color of a rectangle. Hypothetically, assume that all rectangles …

Member Avatar for DanOath
0
22K
Member Avatar for c.pentasuglia

So i'm working on a java program that will eventually be used like a library on an EIS system. My next step is to work with the resource adapter, and i've never done anything like this before. I understand the architecture in this case and what the resource adapter does, …

0
127
Member Avatar for c.pentasuglia

In a nutshell i have a java program that takes parameters from an XML file. I made a .jar file from my java project. Within the java project i have the XML file set to a static directory, i'd like to be able to change that so the jar would …

Member Avatar for c.pentasuglia
0
245
Member Avatar for tleverington1

Hello all, I am having problems setting up a connection with a mysql database that i'm going to need to use for one of my projects. My code to establish the connection is as follows: import java.sql.*; import java.sql.Connection; import java.sql.SQLException; import java.sql.ResultSet; import javax.sql.ConnectionEvent; import java.sql.DriverManager; public class SQL …

Member Avatar for tleverington1
0
157
Member Avatar for Kert

I need to make a checkers board that has to be also resizeable. At the moment I'm using JPanel and it's method paintComponent to paint the squares. But the problem is with the class test: the squares drawn have to be squares and they cant go out of proportion, so …

Member Avatar for Kert
0
186
Member Avatar for memz

help me in this code .. it is not work .. public static void CreateFile() throws IOException { File f; f = new File("myfile.bat"); if (!f.exists()) { f.createNewFile(); System.out.println("New file \"myfile.bat\"has been created"); } } public static void getFiles(String path) { File dir = new File(path); String[] children = dir.list(); …

Member Avatar for memz
-1
305
Member Avatar for blake81

The major issue I am having right now is my client class cannot run/compile, I tried different methods to fix it from calling it from overload constructor and setScores but neither work. Scoresclient.java:16: error: cannot find symbol myScores.setScores(); ^ symbol: method setScores() location: variable myScores of type Scanner Scoresclient.java:18: error: …

Member Avatar for NormR1
0
173
Member Avatar for Traps

I'm trying to create a jUnit test for my EJB's and if my app just contains a few beans everything's all good but as soon as I incorporate JPA and entity-classes my jUnit test blows up. My test fails at ejbContainer = javax.ejb.embeddable.EJBContainer.createEJBContainer(); and the stack trace says the following: …

Member Avatar for Traps
0
480
Member Avatar for Tuz

I have this two classes and its giving me an error when i compile it that cannot access BaseClass. package pckage1; class BaseClass { public int x = 10; private int y = 10; protected int z = 10; int a = 10; //Implicit Default Access Modifier public int getX() …

Member Avatar for NormR1
0
90
Member Avatar for Yozuru

So I have a programming lab that we did in class for a few months but I am having major difficulity on it. These are the directions: > Specifications for Calculate grades using loops 1. Create pseudo code for your program first, to be handed in. 2. Make the program …

Member Avatar for FelineHazard
0
1K

The End.