32,199 Topics

Member Avatar for
Member Avatar for moaz.amin.37

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){ …

Member Avatar for moaz.amin.37
0
310
Member Avatar for haya_1

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(){ …

Member Avatar for haya_1
0
129
Member Avatar for wbbb54

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 …

Member Avatar for samson.dadson.3_1
0
264
Member Avatar for jordan.nunnery.75

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

Member Avatar for samson.dadson.3_1
0
122
Member Avatar for syedmuaz.hassan.3

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 …

Member Avatar for samson.dadson.3_1
-3
191
Member Avatar for silvercats

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.

Member Avatar for samson.dadson.3_1
0
506
Member Avatar for jordan.nunnery.75

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 …

Member Avatar for samson.dadson.3_1
-1
150
Member Avatar for juhitha

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; …

Member Avatar for JamesCherrill
0
519
Member Avatar for Inimitable

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){ …

Member Avatar for Inimitable
0
242
Member Avatar for Slavi

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()); } …

Member Avatar for Slavi
0
144
Member Avatar for DeepakBrian

I want to set font to selected text of JTextARea how to do this. Reply me Thank you

Member Avatar for stultuske
0
65
Member Avatar for moaz.amin.37

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 …

Member Avatar for moaz.amin.37
0
501
Member Avatar for LittleBiscuitz

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 …

Member Avatar for zolymo
0
1K
Member Avatar for mxwarning

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 …

Member Avatar for zolymo
0
927
Member Avatar for Slavi

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 …

Member Avatar for Slavi
0
189
Member Avatar for kayleigh0411

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 …

Member Avatar for stultuske
0
155
Member Avatar for MasterHacker110

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 …

Member Avatar for MasterHacker110
0
223
Member Avatar for maryam_5

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

Member Avatar for jwenting
-3
88
Member Avatar for haider885

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) …

Member Avatar for zolymo
0
157
Member Avatar for Slavi

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 …

Member Avatar for Slavi
0
188
Member Avatar for Stuart_3

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(); …

0
157
Member Avatar for Tanushree_1

i'm making a hospital management project using java and there is a small error "symbol not found ". plzz help

Member Avatar for Slavi
0
89
Member Avatar for Sumith Asanka

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 …

Member Avatar for AndrisP
0
341
Member Avatar for 2384443

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 …

Member Avatar for JamesCherrill
0
342
Member Avatar for moaz.amin.37

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(){ …

Member Avatar for JamesCherrill
0
2K
Member Avatar for ManiVasagam_1

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" %> …

0
86
Member Avatar for divinity02

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 …

Member Avatar for Slavi
0
168
Member Avatar for kayleigh0411

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 …

Member Avatar for stultuske
0
184
Member Avatar for EarhawkPH

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

Member Avatar for EarhawkPH
-1
92
Member Avatar for chubbyy.putto

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 …

Member Avatar for Santanu.Das
0
91

The End.