32,199 Topics
| |
1. is it possible to put 2 values with 1 key into a HashMap? I know the regular put(k,v) won't do it..but I'm trying to override many functions to fit my needs and I can't figure out a way to do it.. let's say the key is a name and … | |
Hi, My java program runs fine on eclipse but when I run it on another system which has Java 1.4.2 I am not able to run it. I am using vectors in my program.It is not able to recognize vectors. '.class' expected Vector<int[]> resulttest = new Vector<int[]>(); hello.java:199: not a … | |
Hey guys, I am very new to Java and I am trying to create a simple GUI and make the background a picture, I've tried to google and look on this site for the answer and also tried to implement the solutions and I simply cannot get anything to work. … | |
I connect a mysql database through a Axis2 web service with J2me app. Every time i insert a data to the database the following exception occurs. java.rmi.MarshalException: SAXParseException in response from server But the operations get completed successfully. Also this occurs only when i try to write a record to … | |
Hello, I have been working on a speech synthesis program using JSAPI and FreeTTS. I now have the code with NO errors (!!!:)) However, when I run the code, it doesn't actually have any audio to it. If I change the text spoken to "This is text that is spoken." … | |
Hello everyone, I am working on a program right now and part of the idea involves a pop-up menu. What I need is something like: A small box in the program, On MouseOver small box, small pop-up menu opens up next to the small box, On MouseOver menu option 1, … | |
I am working on an assignment that calls upon a text file to read numbers line by line. If line 1 number is 1, it looks at line 2 number (ex, line 2 = 13), and uses OneNumber class file to do various methods (such as prime or not prime). … | |
How do I change a component that is called in a different class? for example i have added a button on a jframe then called the frame, then in another class how can i change the setVisibilty of the button that was called in the other class? | |
Does anyone know how to insert a .jpeg into the JPanel of a GUI window? | |
Please am new to Java as a language and I want to use it my Bsc project what do I do? | |
Hi, I am beginner in java programming. I want to create a program that will enable the user to input data? I want to check if the input is numeric or not. How to do it? thanks!!! | |
Tried running ant on some example source and keep getting this error.. Does anyone know as I'm assuming i'm maybe missing the ejb libs but am pointing to the glassfish/jdk which should have them? I also thought JSE compiles JEE code? thanks. [CODE]Z:\My Desktop\ejb3-samples\chapter1>ant Buildfile: Z:\My Desktop\ejb3-samples\chapter1\build.xml common: [echo] BuildName: … | |
Hi all Am trying to Truncate the end of a linear list in java. so that: [CODE] // reduce the size of the list to s by removing all elements // with indices greater or equal to s; return the number of removed // elements; // for example, if the … | |
i am begineer in java and i want to know what are the fields in java and for what they are used??? plz explain in detail | |
Hi, I am writing a code to get pixels value of the entire image and store it into a array. But i am facing the problems, as outlined below. I would be grateful if someone could help me in sorting this out.. Cheers :) [code=syntax] File inputFile = new File("one.jpg"); … | |
hey, i am using the value returned from the accelerometer. it returns me the "roll" value which is between -180 to 180 that adds up to 360. what i want to do is just simply produce this on the screen by drawing a line (g1.drawLine();) that would rotate in the … | |
| I would like to modify this program so that it also prints out the location of the element in the array that contains the maximum, so in System.out.println("The maximum is " + maximum ); it will be more like -- System.out.println("The maximum is " + maximum + "its location is … |
our assignment is we are going to create a calculator(console based) in JAVA but my problem is how could I make equal sign as a terminator.. for example i'll add 5+10. if i press equal.. the answer will come out instead of pressing enter key.. | |
I have a question about programming Java into HTML using the latest version of Tomcat. I'm trying to get the option values from the HTML to go inside the Java program and print out said values. A friend of mine suggested that I create an array of strings and then … | |
C:\My Documents\sprayproject.java:100: <identifier> expected JOptionPane.showMessageDialog("\nTotal fees charged: R"+total+"\nCost exceeding R3000: "+count); ^ 1 error Guys please assist me in rectifying the above error? Following below is my coding... import javax.swing.*; public class sprayproject { public static void main(String[]args) { String name, temp, temp2; int option, acres, farmno, count=0; double cost, … | |
Hy, I have a JPanel within a JFrame. In the menu bar of the frame I have a check button that would show/hide a toolbar within the JPanel. The toolbar is a JToolBar type and is added in the NORTH region of the layout. It occupies the whole region but … | |
hey, i receive one value from an accelerometer that shows the roll of the accelerometer the value ranges from-180 to 180 which is 360 degree angel. what i want is to represent this value on the screen by drawing a line that would rotate accordingly to my accelerometer. this video … | |
Hello, I'm really confused.. If I have a string in Java, let's say "Phillip" and I wanted to store this in an array... e.g. [code] name[] = { "P", "H", "I", "L", "L", "I", "P } [/code] would I use a for loop for the string? Helo? | |
this is the code for my class assignment [code=c] import java.util.Calendar; class ClockThread implements Runnable,KeyListner{ int sec,min,hour; Thread thr; ClockThread(){ Calendar rightNow = Calendar.getInstance(); hour=rightNow.get(Calendar.HOUR); min=rightNow.get(Calendar.MINUTE); sec=rightNow.get(Calendar.SECOND); thr=new Thread(this); thr.start(); } public void run(){ while(true){ try{ Thread.sleep(1000); sec++; } catch(InterruptedException ie){ System.out.println(ie); } if(sec>=59){ sec=0; min++; } if(min>=59){ min=0; hour++; … | |
hi~ i am a beginner of using Javascript.I am doing a project. The project needs: 1.creat a textbox to let the user input their mark. 2.creat a second textbox and a button 3.after enter a mark in the first box and click the button,the second textbox show the grade That … | |
[CODE] import java.io.*; import java.util.Date; public abstract class Customer { //super class customer String customerName; String customerID; String customerAdd; String customerPhone; String dateOfMembership; public Customer(String name, String id, String add, String phone, String date) { //constructor this.customerName = name; this.customerID = id; this.customerAdd = add; this.customerPhone = phone; this.dateOfMembership = … | |
I want to create checkbox inside drop down list box using swings pls some one help me | |
I'm practice to make a program that calculate total value of five products. I want the user can keep input the quantities of one of the five product without return the main menu. So I create a while loop to solve the problems. But the problem I have now, how … | |
Hi I am supposed to modify class employee to implement interface Payable(another class) and declare method getPaymentAmount to invoke method earnings. Method getPaymentAmount would then be inherited by the subclasses in the Employee hierarchy. When getPaymentAmount is called for a particular subclass object, it polymorphically invokes the appropriate earnings method … | |
Everything about this code works fine, except the while loop won't end, even when the strings are perfectly matched. Help, please? [CODE]import java.util.Scanner; public class SecretPhrase { public static void main(String[] args) { System.out.println("Congratulations! You won! Thanks for playing!"); } } [/CODE] |
The End.