32,199 Topics
| |
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 … | |
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 | |
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 … | |
[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" … | |
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 … | |
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; … | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
What are beans? I've seen references to them, but when looking up an explanation, I always get lost and confused..... | |
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. … | |
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 … | |
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 … | |
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. } … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 ] = … | |
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 … | |
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 … | |
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"); … | |
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 … | |
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 … | |
| 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 … |
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 … |
The End.