32,204 Topics
| |
As far as I know, exceptions that are not subclasses of runtime exception or error should be caught (handled). When a file exception occurs, it should be caught because its a subclass of exception class, but how can it be recovered? If file is not found,it sounds silly to recover … | |
I'm suppossed to create a code that user only inputs 1 and 2 OR 99 to exit the program. if user had put wrong number, then gently ask them again... However, when i put 1, it keeps displaying "you've selected 1" and never ends. Also, when i press wrong number … | |
I need to creat a method something like... when the user inputs test1 test2 haha test3 end and display that should contain exact same one as above except "end": test1 test2 haha test3 so the "end" is the keyword to finish the inputing... [CODE] String s = new String(""); String … | |
Hi, I have an assignment that's giving me some problem: [quote] "1.Add methods to your Human that return collections of arms and legs. implement these methods by iterating through the collection of limbs and checking what type of limb they are. Note that you will need to use the instanceOf … | |
This is part of a larger project. I've simplified it here. I am implementing a word search program where word puzzles are produced and displayed. There are two main panels. One is the word search panel where there are rows of letters that spell words in different directions. The user … | |
Hello, I need help!!! Very new to programming. I need a program that will display a menu with the letters C,E,F,L and X for exit and allow the user to select a letter from the menu. If the user selects X,print an appropriate message and end the program. If the … | |
Hi everyone! I have a homework problem and I can't seem to get it to work. We're supposed to make a snowman melt when you click on it with the mouse, but my snowman refuses to melt. I know it's a problem with the mousePressed method in the MeltingSnowman class … | |
I am trying to build an application through which i can send messages from server to client. My application is similar to the windows messenger application of windows operating systems /*(to see windows messenger service go to control panel -> administrative tools -> computer management -> click services & applications … | |
Hi all I was wondering if someone can let me know of a quick and easy way of interacting with a Javascript control on a web page. "<a href="#p189191" name="option66" onclick="selectPollOption(66);" class="vote">Vote</a>" That's the control I would like to activate, I was thinking I could use a regular expression to … | |
I have an applet that is not initializing: [code=JAVA] import javax.swing.*; public class WordSearchApplet extends JApplet { public WordSearchApplet (int width, int height) { } public void init () { new WordSearchApplet (700, 800); } } [/code] Here is the error I get. [quote] load: WordSearchApplet can't be instantiated. java.lang.InstantiationException: … | |
Hello, I'm creating a subclass from an already defined class. Let's say I have a class called Student and it has a default constructor. Now I want to create a child class of Student, but when I create it, it seems that it's taking the constructor instead of the actual … | |
I have a project for school and I cant figure out what to do. I need all the help I can get. Its due tonight and I am stumped. I have spent 7hrs on it today already and Im stumped 100%. Here is the assignment. We use Netbeans to write. … | |
I wrote the code for the following 2 combo boxes which display a drop-down list of dorm buildings and meal plans for a college student. The code works, and both boxes are displayed. I have completed what I have to do, but want to find a way to get the … | |
hello i try to use SLF4J for logging. i try something like this: [CODE] import org.slf4j.Logger; import org.slf4j.LoggerFactory; import util.HibernateUtil; public class Main { public static void main(String[] args) { Toolbox tool = new Toolbox(); tool.helloWorld(); } } class Toolbox { Logger logger = LoggerFactory.getLogger(this.getClass().getName()); public void helloWorld() { logger.debug("Temperature … | |
i am in a first semester programming class and this probably might seem like a dumb questino to everyone here but i have been working on this for along time and cant seem to come up with anything. i am stuck on 2 programs. the first is to ask for … | |
How can I override a method in a base class without using the @Override sign? For example the class Human below overrides some methods in the class Mammal. Do print the output correctly without @ signs in objects. Convert them correctly before outputting. [code]import java.util.*; public abstract class Human extends … | |
I created a combo box for the selection of a dorm.... I need to create another combo box for the selection of a meal plan... Should I write that in another class, or can I add it to this class? I need to display the total of the costs of … | |
Hello, I am trying to write a program that allows the user to enter a letter and using seven different methods to print out the letters. This display should look like this CCCCCCCCCC CCCCCCCCCC CCCCCCCCCC CCC CCC CCC CCCCCCCCCC CCCCCCCCCC CCCCCCCCCC The method printBlock should accept a character and two … | |
Hi, I had posted this question before and I did appreciate the response I got. However I still need some little help as: [B]1.In the addMovieGoers method check that every member of the collection is a human and that they are old enough to watch the movie, if not throw … | |
Hi , I lke to write the angram game. But I dont know how to sort the words in random Ex:the words gonna be lke this ..J H R E I O M C I want to let the user to type the meaningful words to choose among from that … | |
Hi there, I have an assignment due in a couple of days and I need some help. I don't have time to read a Java books. Plus, my teacher is useless as he can't explain anything...and the TAs are worst. My error is in line 145 (scroll down) saying "illegal … | |
Hi there...I can get the input from a user...however I need to add them. I'm thinking I need a loop to add them, and carry the extra if the person adds them. Keep in mind, the max size is 20, and I have no added the error checking in there. … | |
Hi, I am having some trouble with arrays. I have an array of 5 elements. The values of the array are integers. I want to validate the input using an if statement. (the numbers must be between 10 and 100). I then want to compare the user input to the … | |
Hello, I am trying to get this code to work. I am getting an error code on line 38, that I don't understand why. Can anyone help me out. the error code that I am getting is identifier expected. Thanks, countrygirl1970 [code] // Displaying multiple strings import javax.swing.*; // To … | |
hi we have a programming assignment which computes the volume of a barrel. I don't have a compiler yet and java is not yet recognized by my computer yet because I haven't downloaded any JDK yet because I don't know which one to download...Here's my code so far...Please just review … | |
I have got two arrays. One for initializing and another for displaying. The display array always shows nothing if the initializing array has not been called. The problem now though is that if I want to insert something in a certain slot in the array nothing happens and I dont … | |
I am just learning Java. I am trying to do a GUI to calculate road trip data. My program compiles, and a window opens, but only the top title line shows. Nothing shows in the center or south areas. What do I need to change? Here is my file. [code=syntax] … | |
any1 know s anything about cr8ting mobile game "go" need ur help | |
i am new to java, i am writing this program so where when the user inputs RGB values the resultant colour should be displayed on a frame. (note that you cann't use the [B]color class in java[/B]) 1.) i have successfully completed coding for where the user inputs the RGB … | |
Has anyone tried and succeeded in Inter JVM method calls within a single machine. What I mean is I have two separate applications running on the same machine using two JVMs. Can they communicate and if so what are the related packages and classes. antaryami |
The End.