35,618 Topics
![]() | |
I have a list that looks similar to thisand is stored in a text file; last, first, code smith, john, test I cannot figure out why it is out of bounds. Where am I going wrong? is it in the split statement? import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.DataInputStream; import java.io.FileInputStream; … | |
Hello, So I got the following classes: Book BookRegister GUI Main Book contains basic information about what kind of book you want to register. BookRegister contains the linked list for registration. In the GUI, I'm using JList. The thing is, I want to put all my books I register into … | |
![]() | Hey bros. I made a program that prints out random numbers in a linked list. I want to have the index number next to each of the random numbers in the list. I guess for example like: 1 25 2 123 3 56 ect. Here's m program so far, and … |
Hey everyone, having some troubles getting this down mostly step 4 i believe i have everything else correct not sure though. Im not sure how i would go by doing step 4 i can have it print the 9th value but im lost after that.. 1. Create a one-dimensional array … | |
I am having a problem with an address book program. The problem is that when I try to set the fnTextField, lNTextField, ...etc I get null in all the JTextEdits. I've went through the debugger and before the I called `Edit edit = new Edit(1)` the values are in the … | |
Hi, This might sound stupid, but "please" cope with me. I got an image in jpg format which I want to read in an array or something (not sure) I only want the bytes of the image, not the headers, size, thumb etc. Basically what I'm trying to do is: … | |
So my son has learnt Java and has come to a decision point. First, the flashback,:- May, 2011--Back when he was 10 years old and didn't know Java, he gave C++ a try. He understood loops and variables. But when he reached the page teaching functions, he didn't understand a … | |
Per the title, I'm trying to figure out a way to restrict the boundaries of mouseClicked. I have an image that moves across the screen. When I click on it, it alternates with another image. However, I only want it to alternate when I click within 30 pixels of its … | |
I am trying to create a Collection class to deal with getting the data of (the amount of male and female names used from the past 130 years(all separate files)) loaded. I know that I need to implement a read(String filename) method in Collection that reads the given file, looks … | |
I am writing a program that inputs data and creates a graph represented by two adjacency matricies. One matricie contains one weight, and the other a different weight, ie distance and time between nodes. I am recieving the Double cannot be cast to Integer at a point where no Doubles … | |
![]() | hello everyone. I can't figure out how to create a random int that gets placed into a linked list. import java.util.*; import java.io.IOException; import java.util.Scanner; import java.util.Random; public class LinkedListProgram { public static void main(String[] args) throws IOException { int i,number, ran; Scanner sc = new Scanner(System.in); LinkedList<String> list = … ![]() |
I am currently building a search engine using Javaand I'm trying to do TF/IDF. I have got the TF working but am no stuck on the IDF. This is what I have done so far but I can't compile it as I get errors on the imports. Anyone know a … | |
I am almost done with this Hangman game, but I am having problems with the letter buttons and am lost as to what to do to fix the problem... package hangman; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; import java.io.*; public class Hangman extends JFrame implements ActionListener { private … | |
Hey guys Im having trouble with my interface java program I have it all set up but im getting an error on my lowercase button and uppercase. is there a certaint type of formate this needs to be in for interface? here is my code: import javax.swing.*; import java.awt.*; import … | |
This is the Logic for converting a Decimal number to Binary. I'm having confusion in getting it. It would be great if someone make me understand this. for ( long decimal = d ; decimal > 0 ; decimal/=2 ) { binary = decimal%2 + binary ; } If d=4 … | |
package maxmin; import javax.swing.JOptionPane; public class MaxMin { public static void main(String[] args) { final int Tnum = 5; int num[] = new int[Tnum]; for(int i=0; i<num.length; i++) { String numstring = JOptionPane.showInputDialog(null,"Please enter number: ","User Input", JOptionPane.QUESTION_MESSAGE); num[i] = Integer.parseInt(numstring); } int max = num[0]; for(int i=0; i<num.length; i++) … | |
Hello Every one I m new Struts 2 and i m trying to upload a image on server with the help of struts 2 but i was unable to do that i m pasting my code here .. please tell where i m wrong here is my action class package … | |
Hi, I advance thanks for your help Gentles! I am a Leanne, In my new Networking Java Program! (Consider an Small Office Please) At first Every Workers Should Login at Time (The Login details UserName ,PassWord and LocalTiming can stored in their own local database), When the Manager Come latter, … | |
I'm trying to make a deck of playing cards in Java, but when I run my code an error comes up saying java.lang.NullPointerException. This is my code: public class Deck { Card[] card= new Card[52]; Deck(){ for(int i = 0; i<13; i++){ card[i].value = i+1; card[i].suit= "Heart"; if(card[i].value==1){ card[i].value= 11; … | |
here is my code import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.*; /** * * @author Sugirthan */ class Node<E> { int ser; public double[] data; public Node(int ser,double[]data) { this.ser=ser; this.data = data; } } public class Tree<E> { Node a; double [][] data = … | |
Hello, I am developing an Andorid application and I am having troubles with a line of code. I am getting x and y coordinates that have been stored as strings then I try to convert them to integers with x = (int) Long.parseLong(loc1); (x is an int). I have tried … | |
Hello. I have this question: "Amend the subclass of Holiday called Premier with an overridden equals method. Test this method in an orchestrating class with objects of Premier that contain the same data values and with objects that contain different data values." I have searched high and low for a … | |
![]() | Hey everyone, I am making a nqueen program that’ll read me an array of the position of the queen. I developed to different methods to do this. One is the recursion way and the other is the iteration method . My problem lies in the recursion. I am trying to … ![]() |
![]() | Hey everyone. As always I'm sorry for my noobness when it comes to java, but I got a question I can't seem to find answered anywhere else on the web. I'm trying to make a simple program that takes whatever number the user types in, and makes a linked linked … ![]() |
I am using JUnit for the first time and I have small problem: the setUp() method doesn't seem to work for me. public class ClientTest { private Client a; @BeforeClass public static void setUpBeforeClass() throws Exception { } @AfterClass public static void tearDownAfterClass() throws Exception { } @Before public void … | |
I am trying to get this class put together but I've always had trouble figuring out constructors. I don't know what to set the data fields in Customer(int customerID, int checkoutTime, int arrivalTime){} // DO NOT ADD NEW METHODS OR DATA FIELDS! class Customer { private int customerID; private int … | |
I need any Open Source Sentence Grammar Corrector for one of my projects. I searched it on Google but couldn't find any. All the results coming link to only Grammar Checker tools only not grammar corrector. Please suggest me any open source tool which can correct the grammar also or … | |
Hey guys, I'm trying to conver a while loop from C++ to java. And I'm having a problem with my while loop. The original c++ code. // Out of cashiers? // Get next frontBusyCashierQ // Is cashier's finish time now? while(!service->emptyBusyCashierQ() && (service->frontBusyCashierQ(cashier), cashier->getEndBusyTime() <= currentTime)) { ...... .... ... … | |
So im working on a project where im supposed to dynamically load the contents of a .csv file into the database.I have been hard coding the path of the file till now like * inserted = insertFromFile("C:/Users/Student/Desktop/Book1.csv",connection, "customer"); * however now i have to read multiple files from a folder … | |
I have this Die class, which I am working on for a game called Craps. My old method works, but I wanted to try to use dice with a higher number than 6. I can get the program to accept my user input, but how can I get it to … |
The End.