32,199 Topics

Member Avatar for
Member Avatar for xdeja

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

Member Avatar for Taywin
0
4K
Member Avatar for Alex_

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 …

Member Avatar for Alex_
0
160
Member Avatar for trelek2

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 …

Member Avatar for trelek2
0
197
Member Avatar for mihir.p

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

Member Avatar for ~s.o.s~
0
167
Member Avatar for ttboy04

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 …

Member Avatar for ttboy04
0
143
Member Avatar for hazeeel

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 …

Member Avatar for Rashakil Fol
0
54
Member Avatar for djenoe
Member Avatar for Victor C.

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 …

Member Avatar for NormR1
0
193
Member Avatar for abbyo

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 …

Member Avatar for abbyo
0
142
Member Avatar for dylgod

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 …

Member Avatar for Taywin
0
166
Member Avatar for hazeeel

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 …

Member Avatar for remilt
0
80
Member Avatar for mayanknsit

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.

Member Avatar for NormR1
0
210
Member Avatar for RaniThomas

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

Member Avatar for NormR1
0
330
Member Avatar for learner15

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

Member Avatar for NormR1
0
98
Member Avatar for Alex_

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 …

Member Avatar for NormR1
0
1K
Member Avatar for j1979c

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

Member Avatar for peter_budo
0
2K
Member Avatar for varsha solshe

:S what iz event model??? what is its use n why i shud use dis n not others????? plzz xplain wid eg........ w8iting....:-/:?:

Member Avatar for adityats2020
0
84
Member Avatar for djenoe

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.

Member Avatar for adityats2020
0
106
Member Avatar for Eric Cute

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 …

Member Avatar for Eric Cute
0
127
Member Avatar for fankoff

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 …

Member Avatar for bapi
0
96
Member Avatar for pula.alt

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 …

Member Avatar for pula.alt
0
137
Member Avatar for Victor C.

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 …

Member Avatar for baris115
0
113
Member Avatar for NARAVA

please send the correct real time example in java projects of static polymorphism and dynamic polymorphism

Member Avatar for NormR1
0
77
Member Avatar for dani_member

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

Member Avatar for dani_member
0
410
Member Avatar for gedas

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 …

Member Avatar for gedas
0
91
Member Avatar for Krefie

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 …

Member Avatar for Krefie
0
250
Member Avatar for Unbidden Ghost

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 …

Member Avatar for Stefano Mtangoo
0
341
Member Avatar for KcNaveen

Can I create a class inside a method,could anyone Explain me with a simple example ?

Member Avatar for kiwisteffu
0
70
Member Avatar for tajtosh

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....!

Member Avatar for sivasrinu
0
630
Member Avatar for RaniThomas

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 …

Member Avatar for RaniThomas
0
327

The End.