31,001 Topics

Member Avatar for
Member Avatar for sdr001

Hello, I use the code below to get the long lat of the location where the user clicked on a Google Map (in Android). Projection p = map.getProjection(); geoPoint = p.fromPixels((int) e.getX(), (int) e.getY()); It gives me coordinates, however it does not place a decimal in the geoPoint. Any suggestions …

Member Avatar for NormR1
0
120
Member Avatar for TakinANapster

Hello! 1st let me apologize if I have duplicated a post. I am a newbie to DaniWeb (and to Java and HTML) and have searched your forum for a few hours now and not found and answer to my problem. I was hoping someone could help. I have a simple …

Member Avatar for NormR1
0
1K
Member Avatar for jarograv

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; …

Member Avatar for jarograv
0
202
Member Avatar for Stjerne

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 …

Member Avatar for NormR1
0
301
Member Avatar for sonicx2218

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 …

Member Avatar for NormR1
0
329
Member Avatar for brandon66

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 …

Member Avatar for brandon66
0
615
Member Avatar for Mopikope

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 …

Member Avatar for Mopikope
0
153
Member Avatar for erms

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: …

Member Avatar for erms
0
276
Member Avatar for jackbauer24

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 …

Member Avatar for Rashakil Fol
0
498
Member Avatar for makehaste

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 …

Member Avatar for mKorbel
0
139
Member Avatar for FUTURECompEng

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 …

Member Avatar for FUTURECompEng
0
2K
Member Avatar for crazymidget01

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 …

Member Avatar for JamesCherrill
0
412
Member Avatar for sonicx2218

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 = …

Member Avatar for sonicx2218
0
2K
Member Avatar for timzter

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 …

Member Avatar for NormR1
0
156
Member Avatar for tjcrandall

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 …

Member Avatar for NormR1
0
1K
Member Avatar for Thermalnuke

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 …

Member Avatar for NormR1
0
5K
Member Avatar for sadzee

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 …

Member Avatar for NormR1
0
217
Member Avatar for rezal

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++) …

Member Avatar for NormR1
0
205
Member Avatar for bhallarahul

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 …

Member Avatar for singh1720
0
286
Member Avatar for raj.mscking

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, …

Member Avatar for NormR1
0
213
Member Avatar for Nineways

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; …

Member Avatar for NormR1
0
291
Member Avatar for sugir1987

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 = …

Member Avatar for JamesCherrill
0
287
Member Avatar for sdr001

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 …

Member Avatar for JamesCherrill
0
529
Member Avatar for speakon

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 …

Member Avatar for JamesCherrill
0
281
Member Avatar for Gsterminator

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 …

Member Avatar for Gsterminator
0
235
Member Avatar for sonicx2218

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 …

Member Avatar for sonicx2218
0
120
Member Avatar for Kert

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 …

Member Avatar for peter_budo
0
124
Member Avatar for naiiimah

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 …

Member Avatar for NormR1
0
198
Member Avatar for roshan_iiita

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 …

Member Avatar for luzysmith
0
156
Member Avatar for ITOzann

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)) { ...... .... ... …

Member Avatar for NormR1
0
279

The End.