32,199 Topics

Member Avatar for
Member Avatar for java-clueless

I understand arrays pretty well but I am so stuck on where to put it. Everything I enter into the inventory program seems to be in the wrong place or written the wrong way. I am so confused can someone help me? This is the program I have so far, …

Member Avatar for java-clueless
0
208
Member Avatar for cproud21

I have written the following class, and demo, in which I used a default exception (InvalidInputException)... I ran it, and it worked. So I tried my own exception, which I cannot get to work. How do I change the exception that is taken to my own (the Invalid TestScore class)? …

Member Avatar for Ezzaral
0
136
Member Avatar for askhan

[code] public int getMathInformation(int a, char op, int b) throws RemoteException { int result = 0; if(op == '+') result = a + b; else if(op == '-') result = a - b; else if(op == 'x') result = a * b; else if(op == '/') result = a / …

Member Avatar for dickersonka
0
79
Member Avatar for BestJewSinceJC

I'm confused how GridBagLayout can be used as if it was GridLayout(0,2). For example, I would like to lay out components like this: Label TextFieldForLabel Label TextFieldForLabel Label TextFieldForLabel Label TextFieldForLabel I thought by making a GridBagConstraints() Object, then setting the gridx and gridy variables, this could be accomplished (Java …

Member Avatar for Ezzaral
0
105
Member Avatar for NotThereAnymore

I am working on modifying a BankAccount class for a project I'm doing. I am almost finished, but I am stuck on my second constructor. If a user has an existing account (i.e if there is an initial balance), then the BankAccount constructor should call a deposit method to allow …

Member Avatar for dickersonka
0
94
Member Avatar for cproud21

I am trying to write an exception to throw, for an invalid testScore array. If the scores are greater than 100 or less than one. I attached the three classes I have created. I also have to return the average.... If anyone can help I would appreciate it. I am …

Member Avatar for Ezzaral
0
150
Member Avatar for Achupa

Hi, I have a Cinema class as shown in the code below. However I'm required to create my own exceptions and pass them to the controlling module (here method with scenarios). After an exception occurs the code should stop execution of current scenario and go to another one. The code …

Member Avatar for orko
0
128
Member Avatar for JCortes

Hello, I'm building a telephony application and I hava a Javabean with a prperty named callerID, which is updated each time a new phone-call is arriving to my PC. My headache is how to show callerID value in a JSP page. I suppose that I need to use Javascript, but …

0
48
Member Avatar for Achupa

Hi, I have a small question regarding arrays. I have the class Family below: [CODE] import java.util.ArrayList; import java.util.Collection; import java.io.*; public class Family { private Adult father; private Adult mother; private Child[] children; private Dog ourDog; private Cats ourCat; private Rabbit ourRabbit; int Age; public Family() { } public …

Member Avatar for ~s.o.s~
0
130
Member Avatar for IMtheBESTatJAVA

I was asked for my AP Comp Sci online course to construct a program that would calculate fahrenheit to celsius and vice versa, the volume of a sphere given the radius, and the hypotenuse of a right triangle given the two other sides. I was given a program to work …

Member Avatar for IMtheBESTatJAVA
0
505
Member Avatar for joshmo

Hey all. I would like to find out how i can access/ get the value of a variable in a different class. this is part of the code which shows what I was trying to do. [code] public class A{ protected int x; //missing code C obj = new C …

Member Avatar for joshmo
0
138
Member Avatar for Rawrtistic

[B]HELLO There, I am in need of some help for my homework. I am doing the AP Computer Science Lab A10.1 StringUtil an In need of some help. How do I do Number 2? Create a method that receives a string and returns a string that is the exact reversal …

Member Avatar for stultuske
0
164
Member Avatar for ranam

generating triples for branching statements related to compilers lo intermediate code generation in that we have3 address code triple is one of the type of 3 address code little bit urgent can any one solve this i need to complete my assignment plz

Member Avatar for ~s.o.s~
0
112
Member Avatar for cwarn23

Hi and I must know if this script is valid to determine if the Java console and my Java compiler need reinstalling. I have tried so many samples and my browser shows an invalid message. My file is named 'filename.class' and below is the script I have used to test …

Member Avatar for cwarn23
0
472
Member Avatar for ming97

Dear All, I have a problem with Java Programming. I am writing a TatTicToe Program but I found a Error. It is a [B]unexpected type[/B] for [B]mark.equals("X")? currentPlayer=1: currentPlayer=0;[/B] I don't know what happen. If you don't mind , I hope that All people will give some advises to this …

Member Avatar for darkagn
0
89
Member Avatar for Spartan552

Hello everybody, I have various components that I want regroup in the same category. I found numerous screenshots on the internet using some sort of frame surrounding items. For instance : [url]http://www.vieartificielle.com/images_robot/e70d6615e7b9c9ecfacdc7e977425d6d/cache_500_wifi_robot_photo_gui.jpg[/url] (the frame surrounding "Joystick information" section) and [url]http://bp3.blogger.com/_45gEBj4xUTA/RwefQvOgIjI/AAAAAAAAACQ/pKezYz2qQCQ/s320/RobotUI.jpg[/url] (the frame surrounding "Current data" section). I dont know how …

Member Avatar for Spartan552
0
96
Member Avatar for yawjava

I have a code to add a node...what would be a code to remove it if i provide the coeff [code]public void addNode(int coeff, int power) { if (head == null) // start the list { head = new Node(coeff, power, null); degree = power; } else { Node n …

Member Avatar for BestJewSinceJC
0
85
Member Avatar for joshmo

I was reading a tutorial about 2D arrays and I decided to construct something. I managed to construct something but when I compile I get "null" as my output. I cant seem to figure out the problem. Here is the sample code. I have also higlighted in red a line …

Member Avatar for ~s.o.s~
0
584
Member Avatar for jjskywlker

Ok, so I need to enhance the functionality of my existing Loan class to be able to calculate any of the 4 missing elements in a Loan, whether it is the Principal, APR, Term, or Payment. I already have the necessary calculations to get the monthly Payment, but I need …

Member Avatar for stultuske
0
4K
Member Avatar for AdventureX

Hey, I am trying to complete a learning exercise for a rocket program. I already have a Rocket Class but I also need to have a new class to run the rocket program. So far I have wrote [CODE]class RocketTest{ public static void main(String[] args){ Rocket varName = new Rocket(); …

Member Avatar for ~s.o.s~
0
88
Member Avatar for chandanseparate

hi, This is chandan singh from India , studying and working part time to create and helps to create computer software.

Member Avatar for zeroth
0
27
Member Avatar for arunmagar

I have developed web application I m using java beans file to set the values when user login to the system. It set the values of the user. I uses that value in application Whenever the login code calls the beans values are set with new user. The existing login …

Member Avatar for peter_budo
0
63
Member Avatar for hlmrjr

I have a query I am currently working on a program with a lottery theme I will post the parameters as well as my code thus far. A lottery requires that you select six different numbers from the integers 1 to 49. Write a Java program that will do this …

Member Avatar for afzal_01
0
136
Member Avatar for briguy75

I'm doing a homework assignment... I have two files. Payroll (the class) and myPayroll. I run myPayroll and it does everything except return the employee's name and ID number. I'm supposed to pass those values to the constructor... but i'm at a loss as to how to do that. First …

Member Avatar for ~s.o.s~
0
71
Member Avatar for xyster

Hello, I have what is probably an obvious question. I have a basic GUI, one is bsaically no more than a menu in its own class along with a bunch of support classes to do what i want. Another GUI which is for editing the information whcih the main GUI …

Member Avatar for xyster
-1
82
Member Avatar for program_writer

can anyone help me with my problem? this is the case, i have two text file from notepad the first one saved as text1.txt and the other one is text2.txt... the problem is i want to transfer the content of my first file which text1.txt to text2.txt but if i …

Member Avatar for darkagn
0
80
Member Avatar for W@n

Hi, recently i am doing an assignment that require me to do a depth first search on a given graph. However, i cannot get the result i needed. Is there any wrong with my code? Can anyone help? thank in advance=D My graph [code] 0 4 / \ / 1 …

-1
65
Member Avatar for ndeniche

Hello... is there any way of making java listen or capture an F-key input? i mean, like, if the user presses F5, a new panel will come up and that sorts of things... thnx

Member Avatar for ndeniche
0
104
Member Avatar for dwdish

Hi, I successfully send email with the following code in English. However, if the message and the subject title are in other characters, everything becomes question marks and the subject title says something like ...ANSI...3F=3F=3F... How do I set the character encoding to utf-8, for example? Thanks. I have this …

0
57
Member Avatar for jsully1

I have a bit of code my instructor sent me as an example to look at and it is giving me approx 100 errors when I compile it all of the form 'illegal character: \172' or 'illegal character: \8224'. This is a new one on me, was wondering if anyone …

Member Avatar for jsully1
0
115

The End.