32,199 Topics
| |
[I]What I have accomplished so far... Design and implement a Nim class and a NimGame application to allow two human players to play the game of Nim. The game starts with four piles of stones. The first pile has 3 stones, the second pile has 5 stones, the third pile … | |
Hi, i want to do a listener and this is what i have at the moment: [code] class MyListener extends MouseInputAdapter implements KeyListener{ @Override public void mousePressed(MouseEvent e) { if(e.getButton()==1){ out.println("MSE press "+e.BUTTON1_MASK); }else if (e.getButton()==2){ out.println("MSE press "+e.BUTTON2_MASK); }else if (e.getButton()==3){ out.println("MSE press "+e.BUTTON3_MASK); } } @Override public void … | |
Hi! I'm writing a Java simulation of a physical system. I wrote the whole simulation without any problems and later decided to add very simple GUI to paint the current sate of the system after each iteration. This is where the first problem occurred. After creating my JFrame and JPanel … | |
We are planning to make a commercial GUI based software (for both desktop and mobile) targeting individual users. We plan to have good web 2.0 like rich application features (Google like dynamic auto suggest, drag and drop, browser based look and feel etc) and lot of user controls (trees, grids, … | |
Hello, I am getting "non-static variable friends cannot be referenced from a static context" error msg when I complie this program. If I create TreeSet inside the Names method body there is no errors when compiling and it works but that is not how I want it work. Could someone … | |
Hi all, I am a student doing a project on the superposition algorithm. I have to rotate 1 protein on top of the other protein after translation to match it as closey as possible. In order to do that, I need to write the codes in java and also, to … | |
I was creating this code and I hit a brick wall. Maybe because I have been doing this code for 5 hours and I am burnt out. I just need help to get it working please. Here is the code [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.Random; public class … | |
I'm a newbie at java and I need help in coming up with the correct answer for this JOption java program. I enter in 2k, 30fps, 4min, 0seconds, and I should get 10.6842041GB (16.02630615GB total space needed). Please let me know if you have any advice on how I could … | |
Hi I am trying to ride a program that answers a mathematic equation but I keep getting the the error Exception in thread "main" java.lang.ArithmeticException: / by zero at EquationCalc.main(EquationCalc.java:48) I cannot get around it, does anyone have any ideas? [code]import javax.swing.JOptionPane; /** This program will calculate an equation following … | |
I am a student, doing a project on superposition(bioinformatics). I am doing the part on rotation using matrices and I'm stuck. I need to open a visualizer (jmol) and adjust the angles of my protein structure at the same time via java codes. So I need to have 2 protein … | |
Can any one suggest me the java code to find the i/o usage of a process? I am able to calculate memory usage and cpu usage of a process through jav code but unable to do so for io usage. | |
Hi All, I need to write a class to draw and add some components on frame like images,rectangles. I have a class which is already written by some other person, and now i need to add 14 adjacent rectangles on the existing frame. [CODE] import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; … | |
[CODE]import java.awt.*; import java.awt.event.*; import java.applet.*; /*<applet code="actionapplet" width=500 height=600></applet>*/ public class actionapplet extends Applet implements ActionListener{ String msg,str; Button b1,b2,b3; public void init(){ b1=new Button("substract"); b2=new Button("add"); add(b1); add(b2); b1.addActionListener(this); b2.addActionListener(this); } public void actionPerformed(ActionEvent ae) { str=ae.getActionCommand(); if(str.equals("add")) msg="addition is to be performed"; if(str.equals("substract")) msg="subtraction is to be … | |
Sending one image works, but when i repeat the cycle again it just doesn't work. my Client side code (excerpt): [code] for(int i=0;i<50;i++){//fromServer.contains("image") img = ImageIO.read(in); System.out.println("Got image."); label = new JLabel(new ImageIcon(img)); scrollPane.setViewportView(label); fromServer = reader.readLine(); }[/code]On the client side i have this output [code]Got image. Got image. Exception … | |
[COLOR=Blue]Hello.... I'm currently using Netbean 5.0 and I just want to add some GIF files to my program when it builds. I'm using the files as icons for some of the GUI buttons and labels. But when I select clean and build main project or build main project and execute … | |
:S what iz event model??? what is its use n why i shud use dis n not others????? plzz xplain wid eg........ w8iting....:-/:?: | |
Is there other way to write a Menu code, not using Switch, or creating other Method homework : create Menu in Java code i was wondering if it can be achieved not using switch and not creating other methods (public static void Main)(public static void sayHi()) Thank you. | |
Help! Im trying to overwrite a certain record in a text file (basically a log in log out file). Im using Random Access File. I tried to write the updated record using writeBytes but what happens is that it was APPENDED after the record i wish to overwrite. from 150.20.111.0&2010062216:06:31 … | |
How could I like programming ? When you spend 2 days on one single, pointless line and the only thing you get to see is an ERROR-response. It`s really inhuman and I cant imagine who would want this voluntarily. Nevertheless, what am I yammering about is following error, that is … | |
I'm making an application that converts units. I cant not for the life of me figure out why this isnt working. The answer returned is 0.0 when I convert from Fahrenheit to Kelvin or vice versa. The K to C conversions work though. Any insight would be amazing. This is … | |
I am having a problem with my final assignment. Now it began with an apology from my prof on the said assignment because for the pass 9 weeks we have done projects that has focused on a small part like change colors, stream, inheritance, etc. Now the final is to … | |
please send the correct real time example in java projects of static polymorphism and dynamic polymorphism | |
Hello Daniweb users, I am developing a small client for messaging, the messaging part is okay! :) Now the problem is with the GUI. I want to implement a "tabbed chat interface", similar to that of MSN or iChat. I am implementing a JTabbedPane for each "window". My problem is, … | |
hi guys i have been researching about wii remotes and that they could be used to create interactive whiteboards. the software for interactive whiteboard originally has been created by johnny lee in c# well im not an expert in c sharp nor in java :) but i found a version … | |
Ola As I understand functions and methods can be used to reduce duplicate coding by calling the said functions or methods by components or procedures. Now, when is it better(uses less system resources) to use duplicate coding than functions\methods or vica versa, i.e if you have 3 or 4 lines … | |
Hi I am in need of some guidance here. basically I want to know if Java is busy dying a slow death and if it is not what else does one need to learn to have a complete and marketable skill set? java dying slow death: dot net has come … | |
Can I create a class inside a method,could anyone Explain me with a simple example ? | |
Hi, I am creating an application for remainder. and I want it to be run in background and monitor all its tasks. I need help about how to make a java application to be run in background. It should work in linux as well as in windows. Help me....! | |
Hi All, I hv written a java swing class in Eclipse IDE. i hope the code is 100% correct but when im running the class, the error message is displaying in the console. As [COLOR="Red"]Exception in thread "main" java.lang.NoClassDefFoundError: com/cname/lct/madm/gui/madmplugin/rani/ConfirmExitDialog[/COLOR] Below is my code [CODE] package com.cname.lct.madm.gui.madmplugin.rani; import java.awt.*; import … |
The End.