32,199 Topics
| |
if a gui have 2 text fields and there are 10 buttons(0-9) to input numbers in text fields then how it will choose that which field get input. this i problem in my gui i write 2 methods but not working my code is below public void actionPerformed(ActionEvent e){ if(e.getSource()==b1){ … | |
Hi, im having trouble to read from the keyboard the number of employees the user wants and in allowing the user to input up to 10 employees. package application; import dataStructures.*; import java.util.Scanner; /* this is the list of employees * */ private LinkedList<String> employeeList; /* constructor */ public TrainingCourses(){ … | |
Write a program using user-defined methods. Write the following methods: 1. getPrice() which asks the user to input the original price of an item. 2. getDiscount() which asks the user to input the discount rate. The method should return the decimal version of the rate. For example, if the user … | |
create a program that will calculate the current grade in a classroom. The program should ask for 5 grades as well as the total point value per grade available | |
A well-known supermarket employs you to develop an inventory control system. You decided implement it by Object Oriented Programming (Java) because of programs written by Java is easy to enhance and maintenance. The system will control the inventory of 3 shops (Shop 1, Shop 2, and Shop 3). The system … | |
why do most people use brackets in this way when it comes to Java. Pospular IDEs also use this method by default class Test{ public void test(){ } } than this way class Test { public void test() { } } The second method is obviously easier to read. | |
I would like to create a class for finding the voltages of 1, 2 or even 4 batteries. The Class can be called BatteryVoltage with a default voltage value of 1.5 (AA Battery) Must allow the user to find the total voltage of batteries when installed as a single,double, or … | |
when i tried executing my java project i got the following errors Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException: TRANSLUCENT translucency is not supported. import java.awt.Color; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.ArrayList; import javax.swing.AbstractAction; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; … | |
i using abstract method , and always prompt out wiv " not abstract and does not override abstract method " tis kind of error ublic abstract class Person { protected Name name; protected String address; protected String hp; protected String eadd; private static int counter; Person(Name name,String address,String hp,String eadd){ … | |
Hello everyone, I am getting NPE, and surprisingly I can't figure out why ... I am calling a method from a client using java rmi. The method on the server side is as follows : public List<String> getPrinters() throws RemoteException { List<String> listPrinters= new ArrayList<String>(); for(int i=0; i<printers.size();i++){ listPrinters.add(printers.get(i).getName()); } … | |
I want to set font to selected text of JTextARea how to do this. Reply me Thank you | |
i read adapter classes everything is write but i am confuse about Listener Interfaces and Adapter classes concept priblem is that when java create adapter classes it implements corresponding interface and privide defination with empty bodies of all methods that are present in interface this is declaration public class WindowAdapter … | |
Hi i am creating a lottery program and i have managed to get it so the user enters 6 numbers into the program then it will generate random numbers the problem is that the numbers the user enteres can be duplicate i need help trying to not make them duplicates.here … | |
Hello, I am supposed to modify my last inventory program. Here is the instructions. Modify the Inventory Program so the application can handle multiple items. Use an array to store the items. The output should display the information one product at a time, including the item number, the name of … | |
Hey everyone, I am facing an implementaton issue here ... hopefully someone can give me a hand .. So I am implementing a client-server communication, where the server has to act as a print server. In other words, the client simulates to be next to a printer and can send … | |
I am trying to make a program that will tell how much a ticket costs and what the admission status is for a movie based on the age of the person. For ages 1-4 and 55 and up, it is $0.00 and "Free". For ages 5-12 it is $4.25 and … | |
I remember reading in Java's EULA that you acknoledge not to use it for certain things (real time applications). I did a bit of research on this matter and came to the conclusion that it is due to Java's garbage collector that makes Java slower and thus unfit / or … | |
hello i am a computer science student in my final year....please can someone help me wit the source code of an exper system on medical diagonosis in java. tank you | |
I don't know what I am missing. Help me. import javax.swing.*; import java.util.Scanner; public class Operator { public static void main(String args[]) { String num1,num2,op; int ans; Scanner cin = new Scanner(System.in); num1 = JOptionPane.showInputDialog("Enter First Number"); op = JOptionPane.showInputDialog("Enter Operator"); num2 = JOptionPane.showInputDialog("Enter Second Number"); char c = (char) … | |
Hey guys, I can't understand why am I not getting anything from the server, it is supposed to return "Hello" to the client ... I have this code implemented for a game I made during the summer and it works perfectly(of course this is just part of the code), but … | |
Hello, I am a new developer and am making my first app which will be open source after I finish it. How do you make a notification apply to all dynamically created objects rather than the last one in a linear layout? I have created 2 methods, one called CreateDialog(); … | |
i'm making a hospital management project using java and there is a small error "symbol not found ". plzz help | |
Hi Guys i have a formValidation Java Script on the form to validate username and password text boxes to check whether they are empty,and i am calling them on the Onclient Click even ton the button, But even If i enter some data into those text boxes the error message … | |
Hi everyone, i need your help.. I want to draw a circle,square and rectangle on Jframe on a click of a button.. This program was asked in my test paper, i couldn't get it right though bt i wanna know what my mistake is.. Plz help me.. import javax.swing.*; import … | |
i write a code in java of GUI calculator. i handle its addition event only but it is not working i don't know why its code is here import java.awt.*; import javax.swing.*; import java.awt.event.*; class Calculator extends JFrame implements ActionListener{ JTextField jtext; JPanel p; JLabel lab; JButton b1,b2,b3,b4,b5,b6,b7,b8,b9,b0,bPlus,bMinus,bMul,bPoint,bClear,bEqual; public Calculator(){ … | |
I am trying to edit and delete a single record from multiple records.Here below is my sample record displaying on jsp page, ![enter image description here][1] [1]: http://i.stack.imgur.com/suJMS.png I can edit the record for each row easily using below code, <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page import="java.util.List" %> … | |
Write a program that will read two numbers and an integer code from the keyboard. The value of the integer code should be 1, 2, 3 or 4. If the value of the code is 1, compute the sum of the two numbers. If the code is 2, compute the … | |
I need to make this program GradeCalculator.java, and I can't figure out what is wrong with it. I'm really struggling, could someone please help! Thanks!! In the GradeCalculator.java program the user clicks the Enter button. The first input is a JOptionPane that asks the user, “Number of score to be … | |
It's the end of our first semester. We've done the basics of programming on Turbo C/C++. i somehow can't find some comprehensive Java guides in the interweb.. I'm having an advanced study because we're gonna focus on Java on our next semester :D | |
Here is problem: I ask user for how many dogs do you have user enter 5 i go via for loop and add the name into arraylist and now i want to display like 1. Java 2. is 3. fun and so more.... not just 3 after I want to … |
The End.