35,618 Topics

Member Avatar for
Member Avatar for kris0r

Hi all, I am currently trying (and now wondering if) you can add multiple threads to a program to do the same job? Basically I am writing a web crawler for a search engine and it adds many URLs to an ArrayList which is used as a queue. I add …

Member Avatar for kris0r
0
469
Member Avatar for MrVladar

Hi! I am creating a desktop Java application using Netbeans. My task is to generate an array and than sort it (InsertSort, SelectSort, BubbleSort). My question is how do I show the value of all elements from generated array into the textfield? What i have tried to do is: [CODE] …

Member Avatar for MrVladar
0
357
Member Avatar for gman1991

import java.util.Scanner; public class FirstProgram { public static void main(String[]args) { Scanner input = new Scanner(System.in); int x = 3; int num1, num2, num3, num4; while (x <= 3) { System.out.println("enter a number 1,2,3>"); num1 = input.nextInt(); num2 = input.nextInt(); num3 = input.nextInt(); num4 = input.nextInt(); { if (num1 == …

Member Avatar for gman1991
0
89
Member Avatar for sciprog1

Hello Members, I am trying to add weights to a Graph that is implemented using JGrapht. I keep getting a NullPointerException, which I am unable to understand as all other edges seems to be added fine. I would be grateful for any help. The code so far: [CODE]import org.jgrapht.*; import …

Member Avatar for sciprog1
0
2K
Member Avatar for kesh1000

hi can anyone tell me why the netbeans ide generates a null pointer exception. here my code. for class CustomFileFilter [CODE]import java.io.File; public class CustomFileFilter extends javax.swing.filechooser.FileFilter { private String extension; private String description; public void setDescription(String description) { this.description = description; } public void setExtension(String extension) { this.extension = …

Member Avatar for kesh1000
0
184
Member Avatar for djbuclkle

I am currently writing a program in which you input a word and the program then outputs all of the different ways the characters can be moved round into anagrams. I have wrote a way of turning the command line argument into a char array using the toCharArray() now I …

Member Avatar for JamesCherrill
0
172
Member Avatar for joseph.roy9

I have a form in my application in which I want to validate the user inputs. It has a combo box which is populated from db table. So I have to go to the action class first to populate it(for eg: populateFormAction). Then it will go to form.jsp page. But …

0
57
Member Avatar for Effrego

I'm using PrintStream, to put some text in a txt. But how do I append to the end of the file? I saw some code whilst google-ing and it had other inputbufferstream stuff in it. Does PrintStream have its own append option?

Member Avatar for masijade
0
67
Member Avatar for BubblesKulit

hi, i have a problem comparing values in an array and how to display them sample: [code]int[] d = new int[c]; for(i=0,j=1;i<d.length;i++,j++){ d[i]=Integer.parseInt(JOptionPane.showInputDialog("Enter value : "+j)); }[/code] i don't know how to start comparing values of each index's in the array..can someone help me? thanks BTW(new to this forum):)

Member Avatar for peter_budo
0
157
Member Avatar for ARaza110

Hi, I have a problem related to Java servlet sessions. I don't understand why the getAttribute() function of the session object is used before setAttribute(); Here is the code: [code]Vector buylist=(Vector)session.getAttribute("Register"); if (action.equals("del")) { String del = request.getParameter("deli"); int d = (new Integer(del)).intValue(); buylist.removeElementAt(d); } session.setAttribute("Register", buylist);[/code] Thanks.

Member Avatar for mKorbel
0
403
Member Avatar for cwarn23

hi, I have the following code and it compiles on Netbeans with no errors or warnings but when I load the applet in a browser the browser does not display all of the pictures that I got it to draw. The only picture it draws is my_gif. I have tried …

Member Avatar for cwarn23
0
210
Member Avatar for jdm

I'm working on a simple program, but I help with a part of it. When I click the submit button I need the name field to be cleared and for all of the checkbox to be unchecked. I have the name field done, but I need help with unchecking all …

Member Avatar for jdm
0
2K
Member Avatar for MrCapuchino

Hello, I'm kind of new with JSP and I'm developing an school project. So far I have my web application configured to work with a database. Now I have a form that receives a user and a password, then when the user clicks enter, it calls a servlet which checks …

Member Avatar for masijade
0
133
Member Avatar for tracydo

Please help with this program! I wrote & modified this code many time but not quite find a good solution for it. Below are some error after complied. Program problem: Input: student names, student IDs, their courses and letter grades Output to a file in table layout format with: College …

Member Avatar for dononelson
0
500
Member Avatar for Dannyo329

While coding a random Employee storer, I use Scanner, and its .nextInt(); to ask the user for the employee's contact number: [CODE] Scanner Scan = new Scanner(System.in); out.print("\nEnter Employee Contact Number:"); newEmployee.contactNumber = Scan.nextInt(); //(I have a class Employee) [/CODE] I get the error : [CODE] Enter Employee Contact Number:456645 …

Member Avatar for Dannyo329
0
4K
Member Avatar for Armanious

This code highlights all instances of keywords in a JTextPane. I don't think it is very CPU efficient (it has three loops per LINE) It splits all the lines, creates a Matcher for each keyword, and iterates through those, which consequently means slow execution with larger files. The thread is …

Member Avatar for VernonDozier
0
153
Member Avatar for priya1989

hi everyone , m new in development field, currently doing a project for my friend on android, client based application, need help any one....

Member Avatar for JamieLynnSEO
0
63
Member Avatar for kodera

here is the error message: Exception in thread "main" java.lang.NullPointerException at DriverClass.DriverExam.questionsMissed(DriverExam.java:48) at Chapter7ALabDemo.main(Chapter7ALabDemo.java:33) program is to read a answer key txt and a student's answers txt, then the number of questions would be entered to correspond with the txt file. and here is my code in two files: [ICODE] …

Member Avatar for kodera
0
110
Member Avatar for drjay1627

Hello, I want to create an application that can make selections from a webpage. I did an assignment for school and now I want to extend my program. The assignment was to parse a webpage and display the data. The webpage's exact URL was given to us. The URL was …

Member Avatar for drjay1627
0
160
Member Avatar for guccitan88

New to Java! We have to create a "sales" 2D array and initialize it with 100.00. Then we have to up the 3rd quarter by 500.00 and then lower the 4th quarter by 50.00. I know there's something simple I'm missing, but I can't quite figure it out. Any help …

Member Avatar for guccitan88
0
130
Member Avatar for ndiiie

Hi all, I want to ask a question about replacing specific word in a string for example I have a string of: input = a fast nope e i want to replace word "a", if I use method replace which is: input.replace("a", "hello"); the character a in fast will also …

Member Avatar for dononelson
0
182
Member Avatar for chiefpf

I need to write several algorithms and one is giving me trouble. The one giving me issue requires the use of recursion to produce a summation for an integer. For example summation(4)=0+1+2+3+4=10. The code I am working with is: [CODE] public long recursion(int N){ if (N <=1) return 1; else …

Member Avatar for masijade
0
2K
Member Avatar for vJeel

Hi, I would like to learn the backtracking algorithm. I do some prior knowledge in algorithm. Can someone please direct me to a good website that can teach me backtracking algorithm or a video. If someone can teach me on this thread that would awesome. Thank you. P.S I was …

0
41
Member Avatar for JJHT7439

Alright, I admit that I'm struggling a bit with Java but for the project that I'm trying to do I need to create a bunch of bank accounts and then calculate the interest and return the names of the account holders and their balance and interest, as well as the …

Member Avatar for JJHT7439
0
3K
Member Avatar for pooran.c

I need to implement gregorian calendar in java Please give me ideas how to start and what to use?

Member Avatar for mKorbel
0
110
Member Avatar for plasticfood

[CODE]if(count == 4){ qFinal.enqueue(q.peek()); if(count3 == 0){ System.out.println(qFinal); break; } else{ sort(qFinal); } } [/CODE] this code is inside a while loop, and with the break statement, it should break out of the loop right? instead i think the program also executes the sort(qFinal) method b/c after it prints qFinal …

Member Avatar for masijade
0
193
Member Avatar for stephenk291

Basically I need to setup a conditional loop to have the game run up to 10 times and then have it display the results for both the computer and user. I have my display function in the works but how could i setup the loop or counter to run the …

Member Avatar for JamesCherrill
0
238
Member Avatar for eileenc87

Dear All, How can I call a javascript to my VB.Net Window Application. Apprecited for immediate attention..

0
68
Member Avatar for arshi9464

i am implementing a client server arch on LAN, what's more suitable for me to use, jsp or servlets????? let there be max 4 clients for a server...... i m done wid the designing part using AJAX and embedding those in jsp pages. made the database using sql server 2008. …

Member Avatar for arshi9464
0
74
Member Avatar for JaseAU

Hi, I have a web application that allows users to schedule a group of Emails to be sent out. I am using Quartz to do this. I've set up the quartz.properties file, coded all the back end java business logic, but I believe to get this to work on a …

Member Avatar for SoftwareHead
0
512

The End.