31,001 Topics
| |
Hi there, I have this kind of sample table. [CODE] Name Math Science English ------------------------------- Ben 86 88 80 Peter 80 79 83 John 84 90 86 [/CODE] I want to save this result, dynamically, in a "table" in Java. I want it to have a sorting function. Some of … | |
Write a program to enter a score and a points possible for a test, computer the percent, display the percent to 1 decimal place and then display the letter grade (A – F) using a standard scale (90, 80, 70, 60) – use the if ... else if ... else … | |
[CODE]<s:iterator value="listObject"> <s:component template="abc.vm"> <s:param name="text" value="listKey" /> <s:param name="prefix" value="listIndex" /> </s:component> </s:iterator>[/CODE] listKey is keys in a list. i am using iterator to traverse the list. i want to put here internationalization concept.so that when i write key of list then it find its associated values in a … | |
2. Create a class Reals for performing integer arithmetic on real numbers. Each real number has a whole part and a decimal part; your class should contain data components representing both parts as integers and should contain methods to do the following: a. Default constructor b. set the two components … | |
Anyone can to help me solve my java problem? I want 2 shapes to move at the same time when mouse dragged occurs. For example 2 objects name hat and face are created then when I mouseDragged face both face and hat will move together, but when I dragged hat … | |
hey im just having a bit of a problem on reading input from a text file. I know that it is probably something simple but I keep overthinking it. Here is what I am trying to do: I'm trying to read in a line of text that contains musical notes. … | |
I'm writing a program that will ask the user for input and then store it into an array until called to the output screen. here is an example of my code so far. I have no idea how to get the input to store in the array. import java.util.Scanner; public … | |
new to ArrayList and was wondering what I am doing wrong. I keep getting a null pointer exception when trying to addRecord... [CODE] import java.util.*; public class StudentDB { private List<String> studentDB; public StudentDB(String db) { List<String> studentDB = new ArrayList <String>(); studentDB.add(""); } public void addRecord(String recordAdd) { studentDB.add(recordAdd); … | |
I've coded this program but i am getting this error, EmployeeeMain.java:57: non-static method getdata() cannot be referenced from a s tatic context Manager.getdata(); ^ 1 error I've used the same technique in other program , it is working fine but this program is not working !! Why I am getting … | |
I have been incurring errors during compile, in which I cannot seem to figure out where the problem relies. I have a class file which is different from the java file. When running the java file im recieving the error of cannot find symbol. {note both of the files are … | |
I've just started learning some Java, and now I've stumbled upon what may be my biggest enemy so far, Applets. To begin with, they are inconvenient to code and and test. You have to build them in the IDE, (Using Netbeans as of now) create an external HTML which can … | |
Hello Members, What is the largest integer that can be stored in Java? Thank you!! | |
hello every one this program compares loans with various interest rates [CODE] public static void main(String[] args) { Scanner input=new Scanner(System.in); //Prompt the user to enter the loan amount System.out.print("Enter the loan amount:"); int loanAmount=input.nextInt(); //Promp the user to enter the period in number of years System.out.print("Enter number of years:"); … | |
Im trying to make a breakout game. I cant seem get the score to show up, but I was able to get everything else working. [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class PongPanel extends JPanel implements ActionListener { private Paddle paddle = new Paddle(); private PongBall ball = new … | |
Hi everyone, I'm working in netbeans IDE 6.9 for my college project work. I had made my application in such a way that, using single Desktop Pane I used to add all the JInternal Frame to it, and display one by click on the respective menuitem. For e.g. for [B]MenuItem1[/B]: … | |
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; /** … | |
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 … | |
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 … | |
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 … | |
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> … | |
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 … | |
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... | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.