32,199 Topics

Member Avatar for
Member Avatar for ChieftanBill

I am currently building a program where the user inputs up to 1000 numbers (-1000 to indicate the end of input), and a number of equations are to be applied. However I have encountered a problem with the "for loop" in case 1. The variables initialized and modified within the …

Member Avatar for ChieftanBill
0
141
Member Avatar for srinivas88

Using SAX parsing method is there any way by which we can get all the children of a particular node. For example, if i am having a xml like this <a> <b> <c></c> </b> </a> Using DOM parsing i can get all the child elements of <a> with getChildNodes(). But …

0
124
Member Avatar for ChieftanBill

This programming project/assignment had me write a program that lets the user play rock paper scissors with a computer until the user decides to quit, at which point their score(wins, loses, ties) will be displayed. The program I have so far works, aside from the "loop until the user decides …

Member Avatar for ChieftanBill
0
88
Member Avatar for Limiter

Hi everyone, just started learning Java and I realized a very minor problem. I am looking to multiply an asterix "*" by a number so that it is longer. Something like: Code: [CODE] String num = ""; num = "*" * 4; System.out.println (num); [/CODE] Sould output: **** But instead …

Member Avatar for stultuske
0
254
Member Avatar for carlitosway17

Hi I am supposed to create a program that prints out a rectangle made of asterisks using Turtle Graphics in Java I have attached a document describing the project. My code works fine and prints fine but the problem is I cant seem to get the right sequence to print …

0
408
Member Avatar for ishaangt

i am working on an encoder nad i have developed a way to encode my message in terms of (x,y) coordinates..but i have to put these locations on a world map to strengthen my encoder.... im using dev c++ 4.9.9.2 and need a gui base coding for my c++ program …

Member Avatar for ishaangt
0
167
Member Avatar for techie929

Hi, I have a doubt regarding a function myfunc(int i,int j) function. The return value of this function is a vector of type int[ ] .For Example if we pass myfunc(4, 2) it will return a vector {( 1,0) ,( 0,1) ,( 1,0) ,( 1,0) , ( 0,1 ), ( …

Member Avatar for techie929
0
116
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
198
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
210
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
135
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
639
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
132
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
80
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
233
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
55
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
675
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 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 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
178

The End.