35,618 Topics

Member Avatar for
Member Avatar for yani.uk

Hello there. I am trying to create a loop, which will move an objects position to a certain spot, based on a random number generator. Here is the code I have so far; [CODE]public void left() { if (this.getColour().equals(OUColour.WHITE)){ while(this.getPosition() !== this.setPosition(this.getPosition() - getRandomGenerator().nextInt(5) + 1)){ super.left(); } } }[/CODE] …

Member Avatar for yani.uk
0
106
Member Avatar for sugir1987

can you help me to clear the error? [CODE]import java.util.*; class Node{ protected Object data; protected static ArrayList child; protected Node next; public Node(){ next = null; data = null; child=new ArrayList(); } public Node(Object d,Node n){ data = d; next = n; n.child=new ArrayList(); } } public class Tree{ …

Member Avatar for NormR1
0
190
Member Avatar for nlyn

I need help in my Connect Four program. Specifically in placing the user's input on the gameboard & also checking horizonallty, vertically, etc. [CODE]/* * ConnectFour program */ import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.Scanner; public class ConnectFour implements ActionListener { JFrame frame; JPanel contentPane; JButton displayMessage; public ConnectFour() …

Member Avatar for Philippe.Lahaie
0
89
Member Avatar for nijinjose123

Hi, Do anyone know a memory leak profiling tool compatible for java 1.4.2. Your help is much appreciated.

Member Avatar for peter_budo
0
125
Member Avatar for chandub

hai everybody am unable to find full path of file. am using following code to import the file. in internet explore am getting full path, but in firefox(version-8) i'm getting only the file name instead of the entire file path.please help me to find full path of file.. <td> <input …

Member Avatar for javaAddict
0
138
Member Avatar for clerisy
Member Avatar for Thermalnuke

Hey guys, I am trying to figure out how to write out this java Program, I am using JCreater, and I am teaching JAVA to my self if you guys can help and show me a couple of the programs that I am doing I think i will be all …

Member Avatar for stultuske
0
255
Member Avatar for battlex2010

I am making a networking application using sockets for a local area network. How can i make the client side of the application search the network for the server socket? Right now i am getting the input from the user itself about the IP address and Port of the server.

Member Avatar for battlex2010
0
196
Member Avatar for hbluthi

Hey again. Trying to add elements to a DList, this happens when I try to add the second car (500, Porsche). The whole insert algorithm sucks and am strongly considering trying to figure out a better one. This is what shows up in the console: Enter name of file with …

Member Avatar for hbluthi
0
206
Member Avatar for scheppy

pButtonarray [x] [row].putClientProperty ("x", new Integer (x)); I'm using a version of java that doesn't have method overloading for putClentProperty so i have to type new Integer as seen above, and this all works perfectly now I'm trying to assign a boolean to the array like so pButtonarray [x] [row].putClientProperty …

Member Avatar for scheppy
0
277
Member Avatar for bigredaltoid

Hi guys - I need to write a program that reads in a user-input integer and tells if the number is prime or not. I've written up this code so far: [CODE]class primenumber { public static void main(String[] args){ int num = 10; int i; for (i=2; i < num …

Member Avatar for bigredaltoid
0
160
Member Avatar for karanc

So Im trying to make a Coinstar Simulation and pretty much what it does is it adds up all the money and gives me a total. Im a computer science student learning java for the first time so I'm a bit confused as to what code i should put next …

Member Avatar for Philippe.Lahaie
0
300
Member Avatar for riahc3

(This has to be a Java question as it simply works in a txt with a HTML extension....) I have this code: [code] <html><head><title></title></head><body> <form id='formulario' action='index.html' method='post'> <label>Ancho </label><input type='text' name='ancho' id='ancho'><br > <label>Alto </label><input type='text' name='alto' id='alto'><br > <label>Izquierda </label><input type='text' name='izquierda' id='izquierda'><br > <label>Horizontales </label><input type='text' name='horizontal' …

Member Avatar for riahc3
0
81
Member Avatar for free_dom

Hello! Chrome browser starts a new process for each tab. Every tab named as "chrome.exe" on windows and on linux "chromium-browse". For example: [url]http://www.ghacks.net/wp-content/uploads/2011/01/sys_manage.png[/url] I need to list all tab title names of opened processes. Is there any function which gets title (or name or summary or ...) of a …

Member Avatar for steve_kamlp
0
185
Member Avatar for Jigs28

Hi, i have netbeans 6.0.1 but when i just creat a file it gives error even at the line which comes by default. For example @Remote or javax.ejb i have uninstalled and installed it again than to the previous installtion effects remains as it is.

Member Avatar for Jigs28
0
124
Member Avatar for sfovell

Hello, I am programming for my Robotics team, and I have to write code for a dashboard, including different camera feeds and setting up rows or columns for the different elements. I am quite new to Java, but I gotten through most of it except for the rows. I can't …

0
129
Member Avatar for riahc3

Hey Putting this code: [code] System.out.println("Hello"); BufferedImage bufferedImage = new BufferedImage(620, 420, BufferedImage.TYPE_INT_RGB); System.out.println("Bye"); Graphics2D g2d = bufferedImage.createGraphics(); g2d.setColor(Color.black); g2d.fillRect(0, 0, 620,420); g2d.setColor(Color.yellow); [/code] It throws a java.lang.OutOfMemoryError: Java heap space error not displaying the bye. I dont understand as my BufferedImage is nothing at all (simple 620 by 420). …

Member Avatar for riahc3
0
1K
Member Avatar for krishnisilva
Member Avatar for krishnisilva
0
95
Member Avatar for mneha67
Member Avatar for mneha67
0
2K
Member Avatar for CodeJava1

hi could someone help me in giving a tutorial in learning how to write testcases in java. would preffer in netbeans if eclipse dosen't matter, thanks in advance

Member Avatar for krishnisilva
0
341
Member Avatar for creative_m

I wonder why they use private constructors.when I was navigating java documentation I found alot of classes with private constructor.Would you tell me what are the benefits of writting them.

Member Avatar for creative_m
0
471
Member Avatar for vinnyoodles

Hi, I am trying to make a simple snake game, but whenever I try to attach a body piece it appears randomly on the screen rather than behind the head. Also, the body doesn't exactly follow the head either. I checked the code over and over for any problems but …

Member Avatar for cms271828
0
296
Member Avatar for imsinu

can we pass condition of if statement as an argument in any language????????? [CODE]class Matrix { static void loop(char a,char b,char c) { int a[][]=new int[3][3] ; byte i,j ; for(i=0;i<3;i++) { for(j=0;j<3;j++) { if(a b c) System.out.print(a[i][j]+"\t"); else System.out.print(" "+"\t"); } } public static void main(String ar[]) { loop('i','>','j'); …

Member Avatar for JamesCherrill
0
4K
Member Avatar for SasseMan

Hi! I'm looking for a way to only run a few tests instead of all existings JUnit test cases in our automated build, which uses ant. I can't add @ignore annotations in the code since it would take to much time. Is there a way to define which test cases/classes …

Member Avatar for SasseMan
0
219
Member Avatar for webdragon89

I have the code to print prime numbers but I can't figure out how to print the numbers 8 to a row. This is because I have to find all the prime numbers <200. [CODE]import java.util.Scanner; public class PrimeNumbers { public static void main(String[] args) { Scanner input = new …

Member Avatar for hiddepolen
0
639
Member Avatar for cloud02

okay so we have group program and my job was to make it only fool proof which I've done most of it and now my group wants me modify/change the program that we talked about and they chose me to do it even though I Said no and I can't..a …

Member Avatar for cloud02
0
191
Member Avatar for ananyaholla

hello, all I am trying to insert rows from Excel sheet into SQL database by browsing Excel file in java(JSP). I can insert rows using ODBC connetion. But using odbc user should give DSN in program. I need to insert rows by Browsing file to make it user friendly.i.e user …

Member Avatar for peter_budo
0
593
Member Avatar for sam1

hi, I heard there is a plugin for eclispe that you can use to produce the gui part of application, but i dont know the name. has anyone used it? is it easy to work on then writing the gui yourself? thanks

Member Avatar for peter_budo
0
162
Member Avatar for abhijeet P

hello all, I am new to J2ME development rather this is my first code i have written in J2me for encryption and decryption using bouncycastle . It is giving the error which i am unable to find solution for... plz help... :sad: This is the error it is showing in …

Member Avatar for abhijeet P
0
365
Member Avatar for skoon

I am new to programming, so please accept my apologies if this question is simple. I'm creating a program that generates a random maze depending on the starting point you enter. I did every thing but when I execute the program, it doesn't show the path to get out from …

Member Avatar for skoon
0
413

The End.