32,199 Topics

Member Avatar for
Member Avatar for PDB1982

I'm trying to find a way to search an array to see if the values entered bu the user are already in the array. For example, if numbers[0] = 1, and the user tries to input numbers[1]=1, then I want the program to kick an error back that won't allow …

Member Avatar for kvass
0
90
Member Avatar for klasiknonie

Gudday all. Im new to dis site and also new to java programming. I hav an assignmnt to write a program dat computes d grade point average of a set of eight courses and i dnt knw how to go abt it. I wil appreciate an urgent reply pls.

Member Avatar for NormR1
0
32
Member Avatar for subrat_p

I am a learner in java . I want to connect my MYSQL database table to a combo box. I created 3 combo box on my jpanel.When I select first two combo box items its automatically call the data base and show the particular content from my table in the …

Member Avatar for subrat_p
0
1K
Member Avatar for DJGvan23

I would be really nice if someone presents an idea of how to link mySQL with A Java Program.. Tried it many times but unsuccessful. An example would be much useful. Thanks!!!!!!!

Member Avatar for DJGvan23
0
67
Member Avatar for toshiro101

Write an application that reads a line of text from the keyboard and prints a table indicating the number of occurrences of each letter of the alphabet in the text. For example, the phrase To be, or not to be: that is the question: contains one "a," two "b's," no …

Member Avatar for NormR1
0
118
Member Avatar for handrews3583

Here is my code: [code] import java.util.*; public class SavingAccount extends BankAccount { // Begin public class SavingAccount extends BankAccount private double minAmount; public boolean withdraw(double amount) { // Begin public boolean withdraw(double amount) if (getbalance() >= amount + minAmount) { // Begin if statement super.withdraw(amount); return true; } // …

Member Avatar for JamesCherrill
0
260
Member Avatar for aro_kai

hey i had started coding in java.I want to display the pixels format of image with the following code but i get errors...Can anyone suggest my code?? [code]public void Pixelvalue(Image img){ int[] pixelss = new int[w * h]; PixelGrabber pg = new PixelGrabber(img, 0, 0, w, h, pixelss, 0, w); …

Member Avatar for JamesCherrill
0
190
Member Avatar for pavan146

Hi , can any one explain me this code public class Howcome { public static void main(String[] args) { System.out.println(“Bank of America”); [B][url]https://www.bankofamerica.com[/url][/B] System.out.println(“Online Banking”); } even though https:// BofA lyin as orphan string in between this codes compiles and executes fine..???

Member Avatar for pavan146
0
104
Member Avatar for churva_churva

[CODE]import java.util.*; public class EmployeeNames{ private String EmpYee []; private int count; int x; public EmployeeNames(int size){ String EmpYee []=new String [size]; count=0; } public EmployeeNames(){ this(10); } public boolean isFull(){ return count= EmpYee.length; } public boolean isEmpty(){ return count=0; } public void add(int x){ if(! isFull()) EmpYee[count++]=x; else System.out.println("\n …

Member Avatar for javaAddict
0
411
Member Avatar for patishere

how to randomize JLabel array? and how to put image in JLabel array?

Member Avatar for JamesCherrill
0
98
Member Avatar for Bhargavi V

Hi All, Can any one help me in editing a column value in a table and save the changes to the database I am usig a piece of code as follows [CODE] private void process() { // Wait Cursor. CBRCursor waitCursor = new CBRCursor(this); try { // Get the chosen …

0
54
Member Avatar for Vincent Addison

please can someone help me find the uses of the codes below and reference,the kind of book or the internet char At() sub string() toupperCase() tolower Case() equals() Startswith() endswith() equalsIgnoreCase() replace() compareTo() index of()

Member Avatar for JamesCherrill
0
96
Member Avatar for Bhargavi V

Can anyone help me in join the 3 combo boxes with filters The main idea is there are 3 combo boxes when we select an item in the first combo box the related items should apper on the remaining 3 combo boxes and when we select an item on the …

Member Avatar for Bhargavi V
0
319
Member Avatar for beginner21

im currently building a game who wants to be a millionaire..the interface is already done but there was an error..there was an incompatible types exception..here is my code..it says found java.lang.String but expected java.awt.event.ActionEvent..help please [CODE]public class MillionaireBoard extends JFrame implements ActionListener { private MoneyLabels a; private JLabel A; private …

Member Avatar for beginner21
0
207
Member Avatar for kdott

I have a scenario where i am given a file that contains info such as: (just a sample) img01.jpg|Washington DC|aquarium|puffer fish|seahorse img02.jpg|CHICAGO|AQUARIUM img03.jpg|Chicago|fish where the first section is the "image" (just a made-up name, not an actual image) and the rest of the words are keywords. ive been able to …

Member Avatar for NormR1
0
161
Member Avatar for ceyesuma

I am having a problem with running my Derby embedded db. I have to set the path and I tried the following commands. the first one is wrong and I would like to learn how to remove it.please. the other ones do not seem to work . I have a …

0
67
Member Avatar for josirucu

[COLOR=Blue][B]hi.i've written a program that loads #'s into an array and sorts them.The end user then inputs a number and the program is supposed to perform a sequential search for the input number and tell wether it was found or not found.I'm hoping someone canhelp me with my sequential search.binary …

Member Avatar for foxpro21
0
345
Member Avatar for xc3ss1v3

Good morning all. I've run into a slight stumbling block with some code I'm writing. I'm sure you've all seen the numerous Mortgage Calculator threads so I hope you're not too sick of them yet. Basically, I need my code to first ask the user for a decision, then based …

Member Avatar for xc3ss1v3
0
154
Member Avatar for rameezh88

Hey i am a beginner in programming. My code looks like this: public ChatClient1(String screenName, String hostName) { super("Chat"); String host=(args.length<1)?null:args[0]; ...and it continues. The error I am getting when i compile is: cannot find symbol symbol: variable args and its for both the args in the code above. this.screenName=screenName;

Member Avatar for rameezh88
0
114
Member Avatar for BLUEC0RE

Hey! I started using java this year and I finished a java project but when I try moving it somewhere else in my directory it does not execute anymore. My project directory tree goes like this (I am using eclipse)... (ignore the "-") /Root - /bin -- JavaProgram.class -- JavaProgramMain.class …

Member Avatar for BLUEC0RE
0
224
Member Avatar for MikNoz

I'm writing a code in Java where input is a user generated integer string and I have to reverse the integer and check for boolean true or not. I'm stuck at the math portion because I can't exactly figure out the mathematical process of trying to reverse an integer. [CODE]// …

Member Avatar for NormR1
0
104
Member Avatar for Yutxz

My problem is to design a program that uses a mathematical model for heat loss, or Tnew = Told - m(Told - Tair). It also asks me to repeat the code for 60 minutes, generating a new answer every minute. I have completed the code, however I receive no output. …

Member Avatar for javaAddict
0
1K
Member Avatar for JonGR

[code]import java.util.Scanner ; public class Verk6 { static public void main(String[]args) { Scanner scan=new Scanner(System.in) ; double[] a=new double[1000] ; Stats stats=new stats() ; int i=0 ; while(scan.hasNext()) { a[i]=scan.nextDouble(); stats.add(a[i]); i++ ; } Arrays.sort(a, 0, i) ; if(i%2==0) { int m=i/2 ; System.out.println("Median value:"+(a[m-1]+a[m])/2.0) ; } else { System.out.println("Median …

Member Avatar for Xufyan
0
191
Member Avatar for nix_xin

pls help me . . . give me some hints on how to do this program . . . a program that displays a mirrored-right triangle using asterisk. the program should ask the user to enter the number of rows and displays the mirrored-right triangle. the minimum is 3. there …

Member Avatar for Xufyan
0
172
Member Avatar for Bhargavi V

I am getting the following Errors when I am linking the .pdf document I am using the following piece of code[CODE] String lPathPrefix = "file://muceap10.muc.amadeus.net/User Step Folders/BPS_Files/Outlooksoft CPM/01 - Production Environment/01 - Documentation Library/01 - Documents/Daily_Checks/"; String lPath = (lPathPrefix + doccolvalue).replace(" ", "%20"); URI lURI = new URI(lPath);[/CODE] java.awt.Desktop …

Member Avatar for sandcat
0
1K
Member Avatar for pennylynne

Hi!! I have written three classes (two of which are most relevant) and am required to construct an operating calculator. This is the CalculatorPanel: [CODE]/* * CalculatorPanel.java * * Lab 19, COMP160, 2010 * * An alternative GUI front end for the Calculator class * */ import javax.swing.*; import java.awt.event.*; …

Member Avatar for JamesCherrill
0
499
Member Avatar for kimiko

okay i've been using bluej for learning purposes but i kind of hit a snag would it be possible for someone to code me a main method so that it works as stand alone program please [code] public class Circle { private int diameter; private int xPosition; private int yPosition; …

Member Avatar for masijade
0
208
Member Avatar for Wootens

Hi guys, I'm working on a program which is essentially Rock Paper Scissors Vs. the computer. Anyway I'm having a bit of difficulty with it and could use some assistance. I need to use a class method, so I decided to separate the computer's choice in the class method, I'd …

Member Avatar for Laidler
0
379
Member Avatar for jtylerboy222

I believe all of my logic is sound, but syntax is off a bit... -ask for total numbers -for loop to input total numbers -1)input first number -2)throw exception "must be positive" -3)if negative > back to 1 -4)if no exception > calculate average This is my first program using …

Member Avatar for NormR1
0
2K
Member Avatar for Laidler

Im trying to create a program which acts like a fruit machine at the moment i am writing an action listener to work with the spin JButton. i have a number of IconImages constructed. could i possibly set these images as an array and then use the random int method …

Member Avatar for Laidler
0
819

The End.