32,199 Topics

Member Avatar for
Member Avatar for ice_cool

Hello, I am currently doing an assignment which requires the use of hashmaps. The game is called "zuul" which is a text based game. A player class can pick up and drop items and if an item is picked up, the item is taken away from the rooms hashmap and …

Member Avatar for kvprajapati
0
1K
Member Avatar for anandarju

I need to know how to access two tables which has some reference values within the table.I need the Java Code to Fetch Both the tables values which are same and have to display it

Member Avatar for kvprajapati
0
91
Member Avatar for lkw8888

Timeout doesn't work properly.. is there any problem? with my source.. These are relevant source for the TimeOut Thread.. [code] /////////////////////////////////////////////////////////////// public ChatJin() { //Find Local IP Address & Name try { InetAddress myInet=InetAddress.getLocalHost(); System.out.println("My InetAddress "+myInet.getHostAddress()+" name "+myInet.getHostName()); } catch(UnknownHostException e) { System.out.println("InetAddress Error on Port "+8000+" Error code …

Member Avatar for JamesCherrill
0
92
Member Avatar for cool_aj

[code=java] import java.util.*; public class Coin { private Random randomNumbers = new Random(); // flips a coin many times public void flipCoins() { Scanner input = new Scanner( System.in ); int heads = 0; int tails = 0; int choice; do { // display a menu System.out.println( "1. Toss Coin" …

Member Avatar for verruckt24
0
91
Member Avatar for matrix2

24.21 (Modifications to the Multithreaded Tic-Tac-Toe Program) The programs in Fig. 24.13 and Fig. 24.15 implemented a multithreaded, client/server version of the game of Tic-Tac-Toe. Our goal in developing this game was to demonstrate a multithreaded server that could process multiple connections from clients at the same time. The server …

Member Avatar for ithelp
0
349
Member Avatar for codeman01

assistance with the following code: 1. package triangleMod; 2. import java.awt.Dimension; 3. import java.awt.Frame; 4. import java.awt.Point; 5. 6. import javax.swing.JFrame; 7. 8. 9. public class Main extends Frame{ 10. 11. static Point a; 12. static Point b; 13. static Point c; 14. static Triangle tryAngle; 15. static JFrame frame; …

Member Avatar for llemes4011
0
132
Member Avatar for C41R0

[CODE=Java] package ce.ass2; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.logging.Level; import java.util.logging.Logger; import ce.board.Board; import ce.board.MoveData; import java.awt.Color; import javax.swing.JButton; public class TickerBean extends JButton implements java.io.Serializable{ int timeDelay=500; private LifeBean lb=new LifeBean(); private Board tickerBoard; private javax.swing.Timer t = new javax.swing.Timer(timeDelay, new ActionListener() { public void actionPerformed(ActionEvent e) { try …

Member Avatar for quuba
0
124
Member Avatar for K?!

Hi all I'm having trouble using panels in a GUI. I created panels for steps through a programme. Like when you're installing something, you click "Next" and the GUI switches to the following step. So for each of these steps, I've created a JPanel. But I was wondering, how can …

Member Avatar for BestJewSinceJC
0
127
Member Avatar for grisha83

Hello, I am working on the problem. Here is the wording: 6) Specify, design and implement a class that can store an array of integer. The number of Maximum element can be 100. Write methods to : a. Add an integer at the beginning of the array b. Add an …

Member Avatar for hardik.rajani
0
325
Member Avatar for functionalCode

I'm working on a program to upload some files to an ftp. I created a thread the starts the upload when the upload button is pushed. When the upload button is pushed the GUI freezes because it is uploading. What change would I have to make to get the GUI …

Member Avatar for BestJewSinceJC
0
110
Member Avatar for grisha83

Hello, I was reading a book and it says that when we want to add new Node that is not in the Head we have make a selection i.e. selection.addNodAfter(element), before we initiate our method. The question is where do i have to do this "selection"? in my main or …

Member Avatar for BestJewSinceJC
0
120
Member Avatar for llemes4011

What are beans? I've seen references to them, but when looking up an explanation, I always get lost and confused.....

Member Avatar for JamesCherrill
0
39
Member Avatar for kadamati

hi i have a problem with my java program.i can compile and run the java program if i keep them in jdk\bin folder, but i can only compile and can not run if i kept the java program in any other location. can anyone tell me where i'm doing wrong. …

Member Avatar for abbie
0
102
Member Avatar for lkw8888

This is chatting program using etherframe packet. I finished crc, gui , making packet and sending packet. but I can't implement stop and wait timeout resend... I can't implement it.. can anybody help me? import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; import java.io.*; import java.net.*; public class ChatJin implements …

Member Avatar for lkw8888
0
248
Member Avatar for rudypooh786

Write a Java application that creates an array of int initialised with the following numbers: 1 4 9 16 17 21 25 33 37 40 and reverses the contents of the array such that the value in the first element is the value that was at the last element and …

Member Avatar for verruckt24
0
141
Member Avatar for AirmanTheGreat

Hello, I seem to have encountered a problem with this code. [code=java] try { String changeC1 = JOptionPane.showInputDialog (null, "Change the dimensions of silo 1? (y/n)"); } catch (NullPointerException e) { String changeC1 = "n"; // probably also be a good idea to log the fact an exception occured. } …

Member Avatar for AirmanTheGreat
0
172
Member Avatar for freddiecool

Hi, i made a calendar program but now i need to import- export my events with iCal/vCal, any ideas on how to go about. I cant find any tutorial or documentation on it

Member Avatar for Ezzaral
0
212
Member Avatar for number87

I am doing a game and I need to reset the graphics back to its original picture once a new game begins, however when I click the new game button, everything else resets but the graphics do not even though I called repaint. I have included the code for my …

Member Avatar for BestJewSinceJC
0
2K
Member Avatar for ramborambo

Hey need lots of help on arrays! this is the exercise... 1. Write a Java application that creates an array of int initialised with the following numbers: 1 4 9 16 17 21 25 33 37 40 and reverses the contents of the array such that the value in the …

Member Avatar for BestJewSinceJC
0
126
Member Avatar for gabec94

hi! i have written a program that takes a random number from 0-999, 10000 times. I have the program calculating how many times each number comes up randomly, and finds the mode. But my program doesn't include how to find multiple largest numbers, ex. 2 and 4 each come up …

Member Avatar for gabec94
0
244
Member Avatar for puk

Hi, I have a line chart that iv created using jfreechart. The graph has six lines.when the graph comes up, there are no lines on it.This is delibrate. Iv also made six check boxes. The problem i have is that when the check boxes are checked, the lines are supposed …

Member Avatar for BestJewSinceJC
0
86
Member Avatar for jrobw

hi! i have to write a gui window, which draws sierpinskys triangle recursively, i have one main class: [CODE]package triangleMod; import java.awt.Dimension; import java.awt.Frame; import java.awt.Point; import javax.swing.JFrame; public class Main extends Frame{ static Point a; static Point b; static Point c; static Triangle tryAngle; static JFrame frame; private static …

Member Avatar for quuba
0
380
Member Avatar for ramborambo

Hey guys! i need help on reversing numbers in descending order. public class ArrayExercise1 { public static void main(String[] args) { int[] values = new int[10]; values[ 0 ] = 1; values[ 1 ] = 4; values[ 2 ] = 9; values[ 3 ] = 16; values[ 4 ] = …

Member Avatar for ramborambo
0
261
Member Avatar for giri.pankaj

Have written an unscrambler in java. This takes in a scrambled word for input and returns the unscrambled word. The way it works is that it creates all permutations of the provided word (I have borrowed the permutation generating code from daniweb i guess) and compares each word to an …

Member Avatar for iamthwee
0
994
Member Avatar for TaubBaer

I had been creating 5 files and I kept hitting the wall. Hope that you will be able to help me pinpoint the problems. (I am not an programmer by the way.) I had been researching for more details on those problems, no luck. Enclosed are 5 files that I …

Member Avatar for TaubBaer
0
542
Member Avatar for raghuprasad

hi, I am able to display a single image from the database on a webpage using the following code: rs1 = st1.executeQuery("select image from pictures where id='5'"); if(rs1.next()){ int len = imgLen.length(); byte [] rb = new byte[len]; InputStream readImg = rs1.getBinaryStream(1); int index=readImg.read(rb, 0, len); System.out.println("index"+index); st1.close(); response.reset(); response.setContentType("image/jpg"); …

Member Avatar for kvprajapati
0
751
Member Avatar for shahbaz5144842

Hi to all ! Im new to java n i m working on Project of Web base Image Annotation Tool using jsp and java i have to save n retrieve image in to database which im using is mysql How i can store image in to database not the refference …

Member Avatar for deepalihanand
0
106
Member Avatar for KirkPatrick

I have been having a little trouble getting my program to output the results I am wanting. At first I was having trouble with a cast exception at this line: [code]out = (ParseResult[]) ipHostsFound.toArray();[/code] The cast exception was: [code][Ljava.lang.Object; cannot be cast to [Lfilelocation.struct.ParseResult;[/code] So I ended up changing it …

Member Avatar for BestJewSinceJC
0
90
Member Avatar for murrple_1

Hey All, I've been working on this code for a while now, but can't quite come up with a working solution. I'm trying to make a specially designed ImageButton, which extends JButton. Basically, it replaces the regular JButton image with another image. I've figured out everything except this. Every button …

Member Avatar for murrple_1
0
147
Member Avatar for ebosysindia

I have data in ms-access database.I want to export it to Excel on click of a button which is in front end developed in core java. I am working on frames NOT applet. I developed a macro in access to export data to excel. But i dont know how to …

Member Avatar for stephen84s
0
145

The End.