32,199 Topics
| |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 ), ( … | |
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) … | |
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 … | |
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 … | |
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 … | |
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 … | |
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] | |
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 // … | |
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 … | |
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 … | |
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 … | |
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; … | |
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 ? … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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= … | |
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] | |
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 … | |
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 … | |
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 … | |
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(); … |
The End.