32,199 Topics
| |
Is it ever acceptable to make instance variables public? If so, when? | |
hi everybody I have a little problem I can not fill all the cells in the table that I made by java swing can anyone help me | |
Hi Daniweb community! I started learning javascript in school, and the best way to learn is to get into it. So I found a Sudoku game online "http://iphone.janjanousek.cz/isudoku/" and download the files on to my hard drive with much success (all the scripts). The game and site is very well … | |
Hi all, my assignement is developing an API. my API should be used by developer in 2 ways.1 is computer base developer and another 1 is web developer.im using java application.the problem is, i dont know what must i have to develop an API for web user | |
| 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 … |
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] … | |
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 == … | |
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 … | |
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 = … | |
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 … | |
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? | |
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):) | |
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. | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
hi everyone , m new in development field, currently doing a project for my friend on android, client based application, need help any one.... | |
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] … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
I need to implement gregorian calendar in java Please give me ideas how to start and what to use? | |
[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 … | |
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 … | |
Dear All, How can I call a javascript to my VB.Net Window Application. Apprecited for immediate attention.. |
The End.