35,617 Topics

Member Avatar for
Member Avatar for kukuruku

Hi,I am new in Java ,and I was wondering if somebody can explain what is the right way to create new object.Is the only right way the case 3,Am I only overwriting the arguments in the same object in case 1 and 2 Thanks [CODE] public static void main(String[] args) …

Member Avatar for ~s.o.s~
0
199
Member Avatar for kvass

Hi all! In a course I am T.A.ing, one of the students submitted this program as their assignment and I did not fully understand why it wasn't working: [CODE=Java] public class Alphabet { public static void main (String[] args) { char alphabet= 'A'; System.out.println("The following is the English alphabet."); while …

Member Avatar for JamesCherrill
0
211
Member Avatar for greenshell

I am doing a project where I have to make a Facile program that reads and executes statements line by line. Example would be like: LET A 5 ADD A 8 PRINT A END and that would print 13 to the console So I have a class for each of …

Member Avatar for ztini
0
138
Member Avatar for BioJavaPhobic

Below is part of some code I have written. I am trying to see whether nodes in a network are connected, and thus finding 'failurepoints'. I have a vector containing node Ids which I loop through to check for connections using a hasPath method. This all works fine, but my …

Member Avatar for BioJavaPhobic
0
642
Member Avatar for Katana24

Hello - I've used a for loop to fill an array of JButtons with text. Each JButton contains a letter of the alphabet. I've been successful in doing this and adding each button to a panel I created. But my problem is that I've tried, unsuccessfully, to add ActionListener's to …

Member Avatar for ztini
0
2K
Member Avatar for kukuruku

Hi,I have a question ,which one is a better way to set constructor [CODE]public Employee(String name,double hours,double perHour,Date dateOfHire){ id=++count; setName(name); setHours(hours); setPerHour(perHour); this.dateOfHire=new Date(); } [/CODE] or [CODE] public Employee(String name,double hours,double perHour,int day,int month,int year){ this(name, hours, perHour, new Date(day,month,year) ); [/CODE]

Member Avatar for Mitja Bonca
0
123
Member Avatar for carlitosway17

Hi am trying to create a random sentence generator for my Java Class the only issue is it builds successfully and rans fine but the output is not what is expected of the program. It should randomly generate 20 sentences. Here is my code [CODE]// Exercise 16.5 : Sentences.java // …

Member Avatar for carlitosway17
0
6K
Member Avatar for doyler

I've been messing around with basic GAs in Java but I seem to have run into an algorithmic problem but can't seem to find where exactly. My code seems to narrow down the average fitness very quickly, but then seems to hover around the right answer without getting there pretty …

Member Avatar for doyler
0
133
Member Avatar for odiejodie

i am trying complete a simple login where the username and password are flat within the program...... i have absolutely no idea on how to do it! i am using a jdialogue form in netbeans and have designed the facial however i simply dont now how to compare what is …

Member Avatar for mKorbel
0
83
Member Avatar for 24x24

I am to write a program that converts either binary, hex or octal to decimal. We are to use methods for the first time (Not a problem). I have written almost all of the code but the conversion. We can't use int.toDecimal or any shortcut. All must be long coded …

Member Avatar for 24x24
0
234
Member Avatar for SolidSora

I want the program to draw the key that is pressed on the screen. When I press a key, nothing happens. Class where the draw code is: [CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package lab5; import java.awt.Color; …

Member Avatar for Ezzaral
0
157
Member Avatar for deepak.marur

Hi, I'm writing a sample spring web flow app with jsf as view technology. I guess I've got everything right in terms of configuration. However when I click on the "login" commandbutton of the jsf page, the flow does not go the next view (Welcome). Am I missing something ? …

0
130
Member Avatar for JellevM

Dear all, I am developing some software that can deal with MIDI files and do some fun stuff with them, but I am running into some strange trouble when analysing the MidiEvents. I want to list all the MidiEvents occurring in a particular Track, with their tickposition, status, and precise …

0
56
Member Avatar for MrHardRock

Hey, this is the first program I've tried writing using any GUI and I have gotten everything so far, except every time I click my button to try and run my program it just freezes and does not do anything. import javax.swing.*; import BreezySwing.*; public class piGUI extends GBFrame{ private …

Member Avatar for JamesCherrill
0
220
Member Avatar for alreem

Can any one help me with this exercise . . ! I did not understnd it . ? [B] A number is called a proper divisor of N if M < N and M divides N. A positive integer is called perfect if it is the sum of its positive …

Member Avatar for milkhey
0
678
Member Avatar for alemojarro

I can't get my winning to not be zero. And I don't see why. [CODE]import java.util.*; public class Foothill { public static void main(String[] args) { int loop = 1; int winnings =0 ; while ( loop != 0) { String s1 = PullOne(); String s2 = PullOne(); String s3 …

Member Avatar for JamesCherrill
0
177
Member Avatar for kingofdrew

My homework is Write an applet that draw the house shown on the left in Figure 14-32. When the user clicks on the door or windows, they should close. The figure on the right shows the house with its door and windows closed. I basic want a java applet that …

Member Avatar for kingofdrew
0
182
Member Avatar for coervivekmca

how to find tomcat server log for godaddy.com plz tell me how to run server at godaddy.com...plz

Member Avatar for peter_budo
0
327
Member Avatar for manish250

hello all, It is my first post on this site. i have a configuration file which is divided in the blocks like MyServer=localhost MyName=ussd MyUser=root MyPasswd=rnd MyPortNum=3306 Req_thread=20 Sleep_thread=2000 url_timeout=1000 HIT_URL_IP=10.43.14.70 HIT_URL_port=80 [*515#] URL_SUB=GET /subscription/subservice.aspx?Mobileno=?&Channel=USSD&planid=13404&clientid=511&requestType=1&SubscriptionMode=USSD&isbill=1&subid=1340&shortcodeid=49 HTTP/1.0\r\n\r\n URL_UNSUB= PRODUCT= METHOD= [END] [*522#] URL_SUB= URL_UNSUB= PRODUCT= METHOD= [END] [*560#] URL_SUB= URL_UNSUB= PRODUCT= …

0
129
Member Avatar for vigneshd90

Hi, I would like to know if its possible to edit a properties file after the project is deployed. I tried editing the values in the properties file using a classloader. [CODE] ClassLoader classLoader = this.getClass().getClassLoader(); prop.load(classLoader.getResourceAsStream("test.properties"));[/CODE] It reads the values properly but I couldn't write it back to the …

Member Avatar for vigneshd90
0
772
Member Avatar for kingofdrew

I want in java applet if a user clicks on a rectangle another one is draw. [CODE]import javax.swing.; import java.awt.; import java.awt.event.*; public class stuff extends JApplet { public void paint(Graphics g) { super.paint(g); g.drawRect(40, 40, 200, 200); if(g.isSelected()) { g.drawRect(20, 20, 50, 50); } } }[/CODE]

0
97
Member Avatar for puneetkay

Greetings, Hmm, Im not sure Is this the right place to ask this question, Well If im wrong please correct me. Im working in a company as Java programmer that also provide professional training for Java and two of my trainees have created "Stick Snake" and "Snake and ladders" game …

Member Avatar for Dawenlomo
0
1K
Member Avatar for minghia

I have a class which extends JDialog which by default has some text on it and a couple of buttons. Most of the instance of the buttons are "Ok" and "Cancel" so the two buttons have their bounds set. If I try to change the label on the Ok button …

Member Avatar for minghia
0
203
Member Avatar for BioJavaPhobic

Hello, I'm a biologist trying to do some bioinformatics, so new to Java and new to this forum. I've searched all over the forum for previous threads on this topic, but can't find an answer that has helped me. Apologies if I've missed something already posted that may help solve …

Member Avatar for BioJavaPhobic
0
291
Member Avatar for mangopearapples

I don't know why. At all. Just that it won't repaint! My code: [CODE]import java.awt.Graphics; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.JFrame; import javax.swing.JPanel; @SuppressWarnings("serial") public class Frame extends JFrame implements KeyListener{ JPanel content; int W = 200; int H = 200; public Frame(){ setSize(700,250); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setResizable(false); content = new JPanel(); …

Member Avatar for mangopearapples
0
179
Member Avatar for C:\>

I have several buttons in my applet, however in certain case i use fillRect function to draw my whole applet go black, but i want to leave one Jbutton visible. The fillRect function hides my button, but the button comes visible if i move mouse cursor on top of it. …

Member Avatar for Ezzaral
0
223
Member Avatar for MeandJava

Hello everybody I have a problem with my code. On two lines (14 & 17) I get this error: cannot return a value from method whose result type is void. But I don't have add void to my class. Thanks in advance. Greets MeandJava Here's my code: [CODE]package oop_po2; import …

Member Avatar for MeandJava
0
2K
Member Avatar for EmbeddedHelp

Evening all, I have created a program that reads a Data Base contents, displays the information, prompts the user to press enter, then in theory they should enter an account number and that specific accounts details be deleted from the data base. Finally the contents of the data base should …

Member Avatar for Ezzaral
0
176
Member Avatar for emorjon2

Hi there! got some problems. I've developing a multiplayer game there's a class called userServer, that use a file to handle all incoming information. but I can't write to the file for some reasons. here's the code: [CODE] /** * @(#)userServer.java * * * @author * @version 1.00 2011/2/16 */ …

Member Avatar for jon.kiparsky
0
315
Member Avatar for ahmed_fawzy

Hey Guys i wonder if any one could help me in setting a background image for JDesktopPane instead of changeing background colors... i'll be gratefull for Detailed Describtion of any written code Thank you people in advance.

Member Avatar for mKorbel
0
2K

The End.