32,199 Topics

Member Avatar for
Member Avatar for #include <lou>

Hi everyone I am trying to plot the data within the class XYDataset regress, vertically, right now they plot horizontally. Any help appreciated: package brainwavesanalyser; import java.awt.Color; import java.awt.Paint; import java.io.IOException; import java.util.ArrayList; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.plot.DrawingSupplier; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.XYPlot; import org.jfree.chart.renderer.xy.StandardXYItemRenderer; import org.jfree.chart.renderer.xy.XYItemRenderer; import …

0
169
Member Avatar for Jdan2388

Hi, I am writing a game. Three card brag. The rules of the game are 1.Each player is dealt three cards. 2.The hand is then assigned a rank based on the cards recieved 3. The hand Ranks are 0,1,2,3 4. the hand ranks are then compared and the highest hand …

Member Avatar for Jdan2388
0
269
Member Avatar for magg93

I'm really confused with this! I have 2 classes, Club and Membership. In Membership I have the method, getMonth(), and in Club I have joinedMonth() which takes the parameter, 'month' - so a user enters a month and then I want it to return the Membership's which joined in that …

Member Avatar for magg93
0
543
Member Avatar for bobytch

Good day to everyone.. First Here is my code so far.. import java.io.*; public class Inventory { public static void main (String[]args)throws IOException{ BufferedReader bv = new BufferedReader (new InputStreamReader(System.in)); String x, z; boolean y = true; int a, b, c, d = 0; do { System.out.println("--------------------------------------------------------------"); System.out.println(" M I …

Member Avatar for NormR1
0
1K
Member Avatar for wuguo

I got the IndexOutOfBoundException in the following code. but I cannot find where went wrong. import java.util.ArrayList; public class sumArrayList { public static int calculateSumArrayList(ArrayList<Integer> Integers) { ArrayList<Integer> duplicate=new ArrayList<Integer>(); for (int i=1;i<=Integers.size();i++) { duplicate.set(i,Integers.get(i-1)); } return calculateSumArrayListHelper(Integers); } private static int calculateSumArrayListHelper(ArrayList<Integer> Integers) { //first: arrayList size 0 if …

Member Avatar for NormR1
0
141
Member Avatar for usernforce

I've been working through an excersise in a introduction to Java book by Deitel and I have a solution to a problem. The program will compile, but I get a message that says, "Exception in thread "main" java.lang.IllegalArgumentException: adding container's parent to itself" Can Someone please help me? Here is …

Member Avatar for godzab
0
1K
Member Avatar for Viped

Hi, I am trying to learn some basic game programming and already made simple pong game so I thought next step could be simple breakout. I already got ball and bat made by Rectangle. How about bricks, also Rectangle? If so it would be easy to break them just by …

Member Avatar for Viped
0
140
Member Avatar for paramv

Hello everyone,I need some good practise problems in java programming so that i can apply concepts in solving the problems.So any help would be much appreciated.Please refer me to any link or suggest me some book for the same and also I am new to this website so forgive if …

Member Avatar for paramv
0
158
Member Avatar for wallet123

hey guys i have done my codes and its working properly the only thing that's bothering me is that' when i input 52 and 'a' as my name, it wont ouput the right answer (it should be 'a' also) i hope you guys can help me thanks! public static void …

Member Avatar for JamesCherrill
0
137
Member Avatar for iEpic

This is driving me crazy. I downloaded netbeans and love it but for the last 5-6 hours i have been trying to figure out why my java programs is not showing images. When i open it with jGrasp the images and everything loads perfect. With netbeans it will not show …

Member Avatar for NormR1
0
237
Member Avatar for iEpic

The code i used in JGrasp to show the image is not working in Netbeans The code i used in JGrasp is final ImageIcon icon1 = new ImageIcon("image/money.gif"); JOptionPane.showMessageDialog(null, " blah blah", "Text", + JOptionPane.INFORMATION_MESSAGE, icon1); And if i wanted to show an image in JOptionPane.showInputDialog would it be the …

Member Avatar for NormR1
0
4K
Member Avatar for kannan_pahang

You are required to write an application called Customer Billing System. This system will calculate water usage charges for a month that has been imposed by Syarikat Air Melaka Berhad. This system will categorise users into residential users and industrial users and calculate the charges based on data entered by …

Member Avatar for Wazzza95
0
470
Member Avatar for Boyd_

I want to start a collaboration with just 1 Java programmer (intermediate or pro) for building our own graphics library . I have tools for real-time collaborative code editing (a plugin for eclipse), so you don't have to worry about uploading your code on internet and then I have to …

Member Avatar for JamesCherrill
0
195
Member Avatar for kannan_pahang

class Student { // data members private String _studentNumber; private String _studentName; private int _markForMaths; private int _markForEnglish; private int _markForScience; // Set Student Name public void setStudentName(String studentName) { _studentName = studentName; } // Set the student number public void setStudentNumber(String studentNumber) { _studentNumber = studentNumber; } // getNumber() …

Member Avatar for JamesCherrill
0
126
Member Avatar for c.pentasuglia

I'm trying to parse an XML file in Java using the XOM library. Where i'm running into an issue is when i hit nested elements. So in XOM you start with a root node, and i am able to parse the attributes out of that root node, and the three …

Member Avatar for ~s.o.s~
0
114
Member Avatar for sammoto

I'm trying to add the int values of Integer objects within an ArrayList, using a recursion (for the first time). Here's what I have so far: import java.util.Scanner; import java.util.ArrayList; public class SumArrayList { private static int calculateSumArrayListHelper(ArrayList<Integer> duplicate) { if (duplicate.size() == 0) { return 0; } int lastNum …

Member Avatar for curiousgeorgem
0
3K
Member Avatar for sammoto

Hi again, I posted last week about a Go Fish game that I was trying to write - well I've sorted out my past issues and now I'm trying to rewrite my CardPile class (that defines such things as the deck or a player's hand) to consist of an ArrayList …

Member Avatar for sammoto
0
442
Member Avatar for pendo826

0 down vote favorite I am currently making an application to store employee details such as name, id and email address. I am doing this using a HashMap. I am currently having difficulty with a searchByName,id and email address methods. How would i go about writing one ? Here is …

Member Avatar for JamesCherrill
0
1K
Member Avatar for kannan_pahang

Create a class named Student (class definition program). The class contains: • Private attributes to store values of Student name, Student university and Student mark. • A method named initialize() to assign initial value to the Student name, Student University and Student mark as specified in the parameter. • A …

Member Avatar for JamesCherrill
0
101
Member Avatar for efth

I recently left Python behind to pick up Java. In Python, a variable defined in a function could not be called outside of the function. But you could at least let the function return a value, which could be a variable defined in the function. When a variable is defined …

Member Avatar for jLocke
0
250
Member Avatar for Viped

Hi, I have a external class with paint(Graphics g) method and the class itself is working great. I can get it visible by launching it from my launch class by doing add(new Laatikko()); but when I am trying to get it work from third class it wont show up. Basicly …

Member Avatar for Viped
0
286
Member Avatar for Massa3332

public class QueueAsArray implements Queue { protected int[] myArray; int count, size, rear = 0; public QueueAsArray(int newSize) { myArray = new int[newSize]; size = newSize; count = 0; } public void purge() { int index = 0; while(count > 0) { myArray[index] = 0; index++; count--; } rear = …

Member Avatar for JamesCherrill
0
213
Member Avatar for salmansaifi7

when i call the function as System.out.println("Hi..."+i+"Welcome"); where i initialized the value of i as i=50; when this statement is executed, how that function is called... is it called in the way as Sop("hi..."); Sop(i); Sop("welcome"); **please help to understatnd the working..*

Member Avatar for Schol-R-LEA
0
79
Member Avatar for iEpic

For my final project I have to develop a functional flowchart and write a menu-driven Java program, using control constructs and user-defined functions. My question is, what the heck is a menu-driven program?

Member Avatar for godzab
0
549
Member Avatar for gedas

hey guys i found a cool java app that helps me manage my svn directories, you can find it by following this link: http://just-download.com/software-development/other/svncontrol-1.62.zip/12a97 i was wondering whether this is an open source and whether i can get a source code for it as i would like to extend it …

Member Avatar for pritaeas
0
53
Member Avatar for sarathsshanker

//ArrayListEx(main class) import java.io.*; import man.Phone; import man.Person; import java.util.*; public class ArrayListEx{ public static void main(String[] args){ Person p= new Person(); p.setName("yo"); ArrayList<Phone> pList = new ArrayList<Phone>(); Phone ph = new Phone(); ph.setOne("dasd"); pList.add(ph); System.out.println("sgs "+pList); } } My Program has a Person,Phone and ArrayListEx(main class) classes,Person contains an …

Member Avatar for sarathsshanker
0
2K
Member Avatar for hszforu

when i use following code i do not get correct output: In this the function maxHeartRate returns an Integer value.Lets take it equal to 199. public String targetHeartRate() { double a = maxHeartRate()/2; double b = ((85/100)*(maxHeartRate())); String c = a+"-"+b; return c; } Using above code i get String …

Member Avatar for hszforu
0
199
Member Avatar for apanimesh061

Suppose I want retrieve values froma table that are greater than 10, should I first store all the values in a list and then check condition of ">10" using any language or should I just just retrieve all values directly from databse using query : `Select id from table where …

Member Avatar for ~s.o.s~
0
109
Member Avatar for Krokcy

So i have a working network file transfer program now (if you want to see some of the code look at my other '[article](http://www.daniweb.com/software-development/java/threads/426357/networking-in-java-not-doing-it-right)'). But now that im trying larger files, im running into a problem where i run out of memory (which is understandable when the array is 1 …

Member Avatar for Krokcy
0
4K
Member Avatar for naief

Hi all I need to put a program on the server that frequently get data from the web and update the database with these data and this program should do this automatically. Can anyone put me on the Beginning of the road. I read in some websites about servlet context …

Member Avatar for naief
0
100

The End.