32,204 Topics

Member Avatar for
Member Avatar for ladybro

Hey folks, Basically, I am trying to recreate Conway's Game of Life in java. I'm getting input from a file and using it as the first generation. I set up my array and have input working correctly. However, when I'm trying to use a method evaluate my array at certain …

Member Avatar for JamesCherrill
0
175
Member Avatar for shean1488

Hi everybody, I'm trying to figure out how much memory was used for merge sort algorithm. I believe it is just one or two expressions, but can't come up with them by my own. public void mergeSort (T[] data, int min, int max) { T[] temp; int index1, left, right; …

Member Avatar for shean1488
0
331
Member Avatar for kh.taimoor

ii m getting error message "class ,interface or enum expected.can anybody help me please thanks.." import javax.swing.*; import java.util.*; public class StudentBook { ArrayList students; public StudentBook() { students=new ArrayList(); } public void addStudent() { String name=JOptionPane.showInputDialog("Enter the name of the Student"); String rNum=JOptionPane.showInputDialog("Enter the Roll Number of the Student"); …

Member Avatar for DavidKroukamp
0
196
Member Avatar for c.pentasuglia

Suppose i have a standalone java project that performs two main functions, send and recieve. I want to deploy it to the glassfish server to be used just like that. An EJB connects to it though a resource adapter, and i just want it to run one of those methods, …

0
109
Member Avatar for jarograv

I have an assignment that I have been working on that is to modify an existing rock paper scissors program so that I ahve a method that sets the player name and a method that gets the player's name. I have created the methods however it does not allow me …

Member Avatar for jarograv
0
884
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
287
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
286
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
191
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
381
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

The End.