32,204 Topics
| |
double sum = 0; double d; for (d = 0; d < 10; d = d + 0.1 ) { sum = sum + d; } The program has a syntax error because the semicolons in the for loop are in the wrong place. The program has a syntax error … | |
I have one question, when you want to add a game round in a java game, how do you do it, do you use the round().method or do you simply put (round++) + 1? | |
hello!I install tomcat server and set CLASSPATH variable `servlet-api` and my servlets running properly but when i compile and run my old program program of `java 2 SE` then it compile successfully but not run it prints an error message G:\Java>javac BinarySearchDemo.java G:\Java>java BinarySearchDemo Error: Could not find or load … | |
Scanner input = new Scanner(System.in); String secretWord ; String guess, dash = "-", upWord; int numGuesses = 0; int numWord; final String SENTINEL = "!"; System.out.println("Player 2, please look away. Player 1, please enter the secter word: \n"); secretWord = input.next().toUpperCase().trim(); numWord = secretWord.length(); for(int dashNum = 1; dashNum < … | |
Hello, I have problem with jbotton. I have botton decalre it. but how do i access it ? because I have 10X10 or 100 botton. let i want to access 95 botton how can i do that? how do i set the title? here is code import java.awt.*; import javax.swing.*; … | |
I have learnt basic android in the last month. I have learnt about fragments, listview, adapters, acitivties, intents, content providers, databases, animations. I want some basic apps' ideas in which I can implement these things and can improve my learning? I am not too good in Java also. I know … | |
I am trying to output how many students were processed, how many of the students had a February 29th birth date and the birthdate of the oldest student. I figured out how to output the first two except how to output the oldest student. is the ckOldestBirthDate and updateoldestBirthDate in … | |
Hi guys, I have some what of a quick/dumb question. How would one traverse a binary search tree using a loop instead of recursion (An algorithm would be vwry useful if possible)? I appreciate any help . Thanks | |
How to rollback the transaction while spring controller has runtime exception... i found some snippet from google i.e, @Transactional(rollBackFor = Exception.class) I think this only applicable for service class has the exception. I need to rollback controller class has any exception. forexample @controller public class test1 { public void testing() … | |
Apply undo,redo operations on string pool. please friends help me to get its answer. | |
I'm pretty new to Java and I'm taking a class where I need to program an 8-Puzzle Problem in Java. I would love to be able to program it Java in Processing so that I could see the movment of the blocks. I'm generally a vidual learner. | |
I am trying to read a line of numbers in string datatype then parse them into double before reading the next line. I get a nullpointerexception. I am trying to read numbers 4 5 2 first, parse them to double, then do some other calculations before going to the second … | |
We are hosting the Olympic games. Write a program that will track all the details of this hosting. 1. The program should track the countries and their players along with the games that they are participating in. 2. It will track the medal winners for each game. 3. The program … | |
Hi guys, After 10 days of googling and trying I finally must ask. This is not an assignment for school but its a practise one for the upcoming assignment in a few weeks. So i have the weights of 200 oranges in a csv file. With this csv file i … | |
Hello, so I'm a student and in one of my projects I have to capture the image of a client from a WebCamp and then save it on the database. Now, I'm having some problems and doubts. I've found some videos where they use the library JMF (Java Media Framework), … | |
How do you via for loop to get the number? I know how the for work. for (int i = 0; i < 256; i++) { System.out.print (i) //That will print out 0 to 255 } how do you read by as byte while (read is not end) { // … | |
I am looking for Java Webservice Framework that support creation of SOAP as well as REST webservices. I know Apache CXF supports both. Could someone Please suggest more frameworks supporting creation of both type of webservices. | |
hello friends i am trying to do an virus scanning file(antivirus)..i have spent more times but i cant please any one give me the sample source code i can modify it..i also tried CLAMAV but it is not used for me. thanks in advance... | |
find the distance between two numbers(source and distination)in an array.the array size must be more than 5 and less than 10. | |
I've have a String String s = " ~ ( A || B ) && C "; A B C can take 0,1,x they follow Boolean Arithmetic w.r.t 'x' Boolean Arith is as follows 0 || x = x 1 || x = 1 x || x =1 x && … | |
Hi . I am new to java. I am implementing a functionality where by a user fills some textFields and the data is added as a new row in a Jtable.The table will hold more than one row before saving. I created the table using netbeans Swing controls. its variable … | |
Hello, I have to subtacke index to number of file that reading in. and then find if there is having a space and counting how many space that have. But my code never excute the if statement. here is code for (int index = -128; index < 128 ; index … | |
hello, how can i access a variable or object defined in a java class to my jsp in same project? | |
first class GUI - basically trying to use my stack calculation class to use in my first class GUI in my enter postfix expression actionPerformed area? What is the best step to add my stack calculation to evaluate an expression? import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.*; import java.util.LinkedList; … | |
I was looking at these two examples and I was curious what the difference is between JCheckBox and JCheckBoxMenuItem. http://www.macs.hw.ac.uk/cs/java-swing-guidebook/?name=JMenuBar&page=3 https://docs.oracle.com/javase/tutorial/displayCode.html?code=https://docs.oracle.com/javase/tutorial/uiswing/examples/components/CheckBoxDemoProject/src/components/CheckBoxDemo.java These pictures make it look they are the same except JCheckBox is not in a menu but it is easy to add to a menu with the menu_name.add(menu_item) command. … | |
Hi! Newbie on Java. I'm doing this assignment for a cash register program. Our professor just explained what we're gonna do and stuff. Here's what i understood: 1.)Sales report (my code appears on the first diag box) Product ID Product Name Quantity Price 2 Stuff 100 3 Stuff 100 4 … | |
import java.util.ArrayList; import javax.swing.JOptionPane; public class ClientList { private ArrayList<Client> clientData; private final String NEW_LINE = "\n"; private int cursor; //manager mode public ClientList ( ) { clientData = new ArrayList<Client> ( ); buildClientList ( ); if (clientData.size ( ) != 0) cursor = 0; //not empty, place cursor at … | |
I try to it. it still have junk char on it. The thing I try to do is decrypt byte key that w/o using the key. When i test is show me a junk when this code is detele any char that over the 0 to 127 but it not … | |
I am having issue with jmenu popup in netbeans. It only sometimes works. Sometimes I don't get a java popup at all. Sometimes my File and Edit options are completely missing. This is what my code looks like. import javax.swing.*; public class menu { /** * @param args the command … |
The End.