32,199 Topics

Member Avatar for
Member Avatar for katiecathey

I need help with creating the room class and dungeon class, i keep going back and forth and now I am just confusing myself. DUNGEON ADVENTURE PROGRAM PURPOSE: The purpose of this is assignment is for you to practice working with two dimensional arrays as well as to continue developing …

Member Avatar for JamesCherrill
0
703
Member Avatar for Majestics

I want to assigne value to string array but i dont know the size of the array from start... Is there any way to do it Programatically for(int i=0 ; i < unkownSize; i++) string[i] = some value I hope my question is clear.

Member Avatar for NormR1
0
142
Member Avatar for raj.mscking

Good To Meet you All! Sir In my server This is the JButton action for start server private void strsrvActionPerformed(java.awt.event.ActionEvent evt) { getClint(); } This is action Performed sir.., public void getClint() { try { ServerSocket ss=new ServerSocket(1030); try { JOptionPane.showMessageDialog(null,"Server is runing"); while(true) { Socket s=ss.accept(); Service a=new Service(s); …

Member Avatar for NormR1
0
261
Member Avatar for anuj_sharma

Hi, I am trying to get a screenshot of the active window on the screen, for which unfortunately Java does not have an API. It allows me to capture the screenshot of the whole screen but not of the active window. Now, I did a bit of workaround but it …

Member Avatar for anuj_sharma
0
259
Member Avatar for thechadv1

I need to develop a graphical representation of a balanced binary tree using random numbers from an array with the number of elements entered by the user. That part I got down and it is working fine. The next part of the assignment requires me to display the number of …

Member Avatar for NormR1
0
254
Member Avatar for Johannady2

/*This code counts the vowels in strings? It has to use user defined methods: */ import java.lang.String; import java.io.*; import java.util.*; public class vowelConsonant2 { static Scanner scan = new Scanner(System.in); public static void main(String args[]) { String text; int actualI, actualC; System.out.println("Enter the String:"); text = scan.nextLine(); System.out.println("There are …

Member Avatar for NormR1
0
277
Member Avatar for IIM

Anyone have idea about how can we use webcam to take pictures in java. Is there any specific port or something to enable webcam? Wondering how to do this. I don't want to use API like JMF or something.I just want to know how can we establish connection and get …

Member Avatar for IIM
0
89
Member Avatar for huphane

public class Exercise { /** * @param args the command line arguments */ public static void main(String[] args) { String A[] = { "Joseph","Ariana","Xena","Rene","Peter","Diana","Rihanna"}; String B[] = {"Madona","Diddy","Joe","Alice"}; for(int j = 0; j < A.length; j++) { for(int s = j +1; s < B.length; s++) for(int i = 0 …

Member Avatar for NormR1
0
281
Member Avatar for Constantine08

I would like to know how to compile the jBullet demos, found here: http://jbullet.advel.cz/download/jbullet-20101010.zip in the eclipse IDE. It seems like it should be a fairly easy but i may be missing some small simple task. If you do know the answer, please be fairly direct and detailed. Thanks!

0
139
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
121
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
214
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
302
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
330
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
288
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
142
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
415
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
157
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
220
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
206
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
287
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
214
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

The End.