32,199 Topics

Member Avatar for
Member Avatar for deleti0n

I don't know why it throws the exception any ideals?? heres my error: the line it tells me is throwing the exception is highlighted in red: run: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4 at lab32analyzingscores.Main.main(Main.java:15) Java Result: 1 BUILD SUCCESSFUL (total time: 11 seconds) [CODE] package lab32analyzingscores; import javax.swing.JOptionPane; /** …

Member Avatar for deleti0n
0
127
Member Avatar for ubc_dc

Hi all, I'm looking to program a webcrawler which will be used to search for specific strings in a large website. I'm thinking that it would be ridiculous to store each downloaded page locally, and then parse it for the strings but I really don't know how else I could …

Member Avatar for ~s.o.s~
0
105
Member Avatar for PDB1982

How do I, if it's possible, take in user input to fill an ArrayList<Integer>? This is what I have so far, but the code doesn't let me incorporate user input. I'm having a hard time figuring this one out... [code] import java.util.*; public class Duplicates { Scanner input = new …

Member Avatar for eman 22
0
989
Member Avatar for flyingcurry

The program is supposed to find all the combinations of the letters in "computer", the algorithm was given to me, but I don't have any idea of how it dos its work, all I get from this is a an infinite amount of "nullp" Here is the code: [CODE] public …

0
90
Member Avatar for PDB1982

I'm trying to find a way to find, and remove, duplicates in an ArrayList without using sets or hashes. This is what I have so far, but I keep getting the following error: [code] import java.util.*; public class Duplicates { Scanner input = new Scanner( System.in ); int i; ArrayList<Integer> …

Member Avatar for PDB1982
0
463
Member Avatar for Sammy91

I have written a program that does exactly what I want it to do, except one problem. I cannot get the program to loop properly. In its current state, it will ask for an input, process that input and then provide an output, it will then ask the user again …

0
52
Member Avatar for Noorul Ariff

Hi friends... My friend s doing an online project... He wants to know how many users(REGISTERED) are LOGGED-IN CURRENTLY in his site... i.e if i'm ADMINISTRATOR of this DANIWEB, i want to know the USERS CURRENTLY LOGGED-IN... I need the logic for this... Help me... Thanks in advance...

Member Avatar for sirlink99
0
73
Member Avatar for andufie

I need help doing this homework. I have spent more than a week doing this without any success The suggestion is to maintain two extra links in each node, one to the inorder predecessor and one to the inorder successor in the tree. Implement this idea, and write code to …

0
90
Member Avatar for iphoneepidemic

I have to use constructors in my assignment so i decided to create two mazes (using arrays) and save them in two separate classes (maze1 and maze2). Then i called the array and save the reference to another array named mazeChoice (Line 23) . After, i try to print out …

Member Avatar for iphoneepidemic
0
282
Member Avatar for endsamsara

Hi, well I need to do a program in Java that shows the solution of the famous game 8 puzzle (the object of the game is to place the tiles in their place with the less possible movements) So using the class Astar Given by our teacher we are asked …

Member Avatar for Weixing
-1
5K
Member Avatar for jems5

I am trying to output a checker pattern into a two dimensional array. How do I assign two characters in order to do this? Note array is a square [5][5] Please help. [CODE]// Takes two symbols and places them in alternate cells of board public static char[][] placeSymbols(char charY, char …

Member Avatar for jems5
0
2K
Member Avatar for gedas

hey everyone, i am creating a project from already created code below. this is just one class of it. this class projects 4 or less points on the image. the source for those points is received from wii (gaming consoles) remote that tracks infra-red light so it displays infra-red light …

Member Avatar for gedas
0
145
Member Avatar for rinjin07

YO, I would be EXTREMELY grateful if someone can help me out with some boolean method stuff. I have this assignment where we've been building up this bank account project thing, and at the moment I've been asked to put in a boolean method called inBalance that returns true if …

Member Avatar for rinjin07
0
190
Member Avatar for iphoneepidemic

I have to use constructors in my assignment so i decided to create two mazes (using arrays) and save them in two separate classes (maze1 and maze2). Then i called the array and save the reference to another array named mazeChoice (Line 23) . After, i try to print out …

Member Avatar for iphoneepidemic
0
132
Member Avatar for AaronLLF

I followed through a Java/LWJGL n lloydgoodall.com for a first person camera. There were about 33 errors that I fixed, though I get a message in the Eclipse console "java.lang.NoSuchMethodError: main Exception in thread "main" " Here is my code: [code] import org.lwjgl.Sys; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.GL11; import org.lwjgl.input.*; import …

Member Avatar for kramerd
0
668
Member Avatar for kamweshi

Hi, can anyone help me to split the servlet(week02_4) so that only control code remains.I need to forward/redirect request/responses to two other servlets(VowelFrequencyServlet and WordCountServlet).I am not sure where to place the RequestDispatcher. Week02_04 servlet: [CODE=java]package servlets; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class Week02_04 extends HttpServlet { protected …

0
120
Member Avatar for johnlop1

So i have this input.txt file, and there are 5 entries in it, I want to take each entry( in the format of Image1.jpg, Image2,jpg, etc) and store it into an arraylist. Then use java GUI to display each image by clicking a button, from image1 to image5. First I …

Member Avatar for JamesCherrill
0
114
Member Avatar for Megha SR

what is the difference between call by value and call by refers=ence? can you please give an example to illustrate it?

Member Avatar for peter_budo
0
70
Member Avatar for Intrevix

I'm having a lot of trouble understanding an assignment we were given today. It has to be written using only loops. I'm finding it a little hard to comprehend right now, so just a bit of guidance on where to start would be great. I understand that the program would …

Member Avatar for JamesCherrill
0
132
Member Avatar for sam1

hi I was wondering which one do you think is the best? I have been using netbeans but have no experience with eclipse, so i can not say which one is best :lol:

Member Avatar for peter_budo
0
104
Member Avatar for acidking001

I am using Netbeans. I have one JFrame with JMenu, and one JDialog. I want to show the dialog when i click the menu, but it doesn't work. I only wrote this codes to my jframe and i didn't add or change any codes on the dialog: [CODE] private void …

Member Avatar for peter_budo
0
312
Member Avatar for shreeswetha
Member Avatar for otherdummy

Hi, I have just started my first semester in a Bachelor program 'Computer Engineering'. I have above basic knovledge in Java SE and currently am interested in Python. The problem is that I'm facing some difficulties in determing my purposes about my future career in IT field. I used to …

Member Avatar for etftw
0
248
Member Avatar for starkz_123

[CODE] #include<stdio.h> #include<math.h> #define min(a,b) (((a)>(b))?(b):(a)) #define abs(a) (((a)>(-(a)))?(a):(-(a))) void convert( int bod, int *x, int *y, int *z ) { int a; int b; int c, str, zb; if( bod==1 ) { *x=0; *y=0; *z=0; return; } a=(bod-2)/6; b=(-1.0+sqrt(1+8*a))/2.0; c=bod-1-3*b*(b+1); ++b; str=(c-1)/b; zb=c-str*b; switch( str ) { case 0: …

Member Avatar for digital29
-1
224
Member Avatar for fofo123

using java netbeans you will try to use "brute force" to decrypt an encrypted message, where you only have the first 96-bits of the 128-bit secret key (last 4 bytes of the secret key are missing!) The program should be called findk, and invoked as follows: findk cipher_file key_file where …

-2
39
Member Avatar for johnlop1

I want to read an input from a text file: Test1.jpg Test2.jpg Test3.jpg each name is separated by an empty line, i want to get all the names and store them into a arraylist. I am using while((line=inputFile.readLine())!=null) will this work because when it hits the empty line, it will …

Member Avatar for Ezzaral
0
93
Member Avatar for cool girl

Hi very one could someone help me with "delete method for Array" I wrote this method in class Array but I didn’t know how could I decrement the size of array and I couldn’t make it work this is the method [code]public void delete(int c) { for (int i=0;i<a.length;i++){ if(a[i]==c) …

Member Avatar for kramerd
0
114
Member Avatar for ceyesuma

I keep getting this error. The app is looking for a class and in fact so am I where should this class be? I can't find it in the: [b]db-derby-10.6.2.1-bin[/b] and check sup of the dl said it was unaltered? Thanks [code] java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) …

Member Avatar for ceyesuma
0
1K
Member Avatar for johnlop1

How do I write an event listener that displays an image when I click the upload button? so far i have [CODE] jButton1 = new javax.swing.JButton(); jButton1.setText("Upload"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } });[/CODE] and then [CODE]//the LOAD button for loading the file private void jButton1ActionPerformed(java.awt.event.ActionEvent …

Member Avatar for Ezzaral
0
111
Member Avatar for plasticfood

[CODE] String[] names = new String[namesListSet.size()]; int[] nums = new int[namestimesSet.size()]; namesListSet.toArray(names); [B]namestimesSet.toArray(nums);[/B] for (String s : names) { System.out.print(s); } [/CODE] i'm getting an error on the bold part. getting symbol not found.

Member Avatar for plasticfood
0
80

The End.