32,199 Topics

Member Avatar for
Member Avatar for friendskhaled

Please Help me I can't start with this project ! Implement a city 'database' using unordered lists. Each record contains the name of the city (a character string of variable length), the mayor of the city and the co:ordinates of the city as integer x and y, Your system should …

Member Avatar for masijade
0
268
Member Avatar for TheComputerGuy

So when I compile, everything will compile just fine. When I go to run the program, I get this error [CODE]Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at ClientForNoDupCollection.main(ClientForNoDupCollection.java:20)[/CODE] I go to look at line 20(actually 19-21) [CODE]public static void main(String args[]) { File file = new File(args[0]); Scanner cReader = …

Member Avatar for masijade
0
195
Member Avatar for mikej39

I have this code i compile it and it ran but nothing came up can someone help with this? [code]import java.util.Arrays; import java.util.Comparator; import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.text.DecimalFormat; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import …

Member Avatar for Zaad
0
178
Member Avatar for cutterpillow20

Good day sir, can you help me where can i download JDK in java. i have already download JCREATOR pro but i can't download the JDK. i already ssearch JDK but when i download it, it is always interrupted. and i don't know what kind of JDK i download.. can …

Member Avatar for cutterpillow20
0
150
Member Avatar for caswimmer2011

Hello, I am confused between the differences between a key logger and key listener in Java....i looked online but I couldn't find a straight-up answer. Thanks in advance!

Member Avatar for Vreality
0
436
Member Avatar for cecsFTL

I'm writing a program to ask the user for 6 points for a triangle and then calculate the length of the 3 sides, the perimeter, and the area. Then the tester will have to display the properties of the triangle, length of sides, the area, the perimeter, and if the …

Member Avatar for hiddepolen
0
1K
Member Avatar for Jessurider
Member Avatar for peter_budo
0
86
Member Avatar for squizzel

Hey Guys, I am new here but looking to come here often and obtain some leet skills in java. I am new to programming but do enjoy it. I was just assigned some homework that has me stumped. I would go talk to someone at my school but they are …

Member Avatar for Anyday
0
183
Member Avatar for Lendaanx

Im new to java and trying to get buttons to work. My next button works as intended however the first and last do not and the previous one only takes me back one space if i'm on the second item. I need the prev button to rotate backwards through the …

Member Avatar for hiddepolen
0
181
Member Avatar for xiangzhuang

Hey guys I keep getting the "no return statement error in two places, I have commented them for you [CODE] /** * A WordsCompare object stores Strings. It is used to determine if the first word * should be placed before or after the second word in the dictionary */ …

Member Avatar for JamesCherrill
0
289
Member Avatar for soham.m17

I want to add a Lable in a JComponent when a button will be clicked. I have added a actionlistner on that button. I've added this.add(label) in the JComponent. but the location, which is set by label.setLocation(...) is not maintained in the JComponent. If i use FlowLayout() in the JComponent …

Member Avatar for JamesCherrill
0
120
Member Avatar for rahulrulez

Hey there. I'm planning to develop a software for my father's business. The software is very simple, it has two tables. 1. Stock 2. Sale Whenever stock arrives, the quantity and content will be added to Stock table.. Structure is something like 1. Stock Table | Brand | Quantity | …

Member Avatar for peter_budo
0
210
Member Avatar for dandeliondream

Hi, I wish to display the homepage of 3 websites (e.g. [url]www.msn.com[/url], [url]www.google.com[/url], [url]www.apple.com[/url]) on screen. What should i use? Is there a tutorial somewhere?

Member Avatar for Anyday
0
134
Member Avatar for jklasd

I have a problem with getting an input from class A to class B. I already created a method which gets the value but when I call it in class b it returns empty. These are my codes: [B]CLASS A[/B] [CODE] public class log extends javax.swing.JFrame { public String name; …

Member Avatar for Anyday
0
3K
Member Avatar for gahhon

[CODE]import java.util.Scanner; public class Bakery { private static String flavors; private static String weight; private static int quantity; public Bakery(){ this("Chocolate Moist", "1(KG)", 1); } public Bakery(String flavors, String weight, int quantity) { this.flavors = flavors; this.weight = weight; this.quantity = quantity; } public void setFlavors(String flavors){ this.flavors = flavors; …

Member Avatar for gahhon
0
120
Member Avatar for gahhon

[CODE]import java.util.Scanner; public class Course { private String courseTitle; private double feesPerStudent; private int noOfStudents; private String[] studentName = new String[100]; private int courseCount; public Course(String courseTitle, double feesPerStudent) { this.courseTitle = courseTitle; this.feesPerStudent = feesPerStudent; } public void setCourseTitle(String courseTitle){ this.courseTitle = courseTitle; } public String getCourseTitle(){ return courseTitle; …

Member Avatar for gahhon
0
201
Member Avatar for djmonster

Hello All, Can everyone help me to solve this problem ? Im doing an assignment about downloading a file and write it to a new file. My problem is the file that I was trying to download is very large, so everytime I compile my Download class and the main …

Member Avatar for Anyday
0
195
Member Avatar for gahhon

is that any good ideas to fixed the aligment of the output instead of using \t, due to some of the output words have more or less. :)

Member Avatar for stevanity
0
84
Member Avatar for melkai

Hello, Working on my final project for a Java Class and have become stumped on the final leg of the code. We are supposed to create a program to add a record, remove a record, display a record, and list all records. The records must be written to a file. …

Member Avatar for stevanity
0
399
Member Avatar for vaironl

I had quiz today in my IB CS course, and I had a question I could not understand, I will try to stated as closed as possible. "There is an array of integers which holds an unknown amount of integers but it's not bigger than a 100. if a = …

Member Avatar for Akill10
0
191
Member Avatar for Dwillich87

Alright I think I'm getting closer but now my program skips by my System.in feature so the radius is never enter and just runs to completion any help would be greatly appreciated [CODE]import java.util.Scanner; public class Square { static class Circle { float radius; public double CircleInfo() { Scanner in; …

Member Avatar for Akill10
0
126
Member Avatar for moonL!ght

hi evry one ,im not used to java and i hate its bad compiler can any one tell me whay it give me this running time error:array index out of bound! this is the code were it have the erorr: [CODE] public class RotatingBieChart extends JApplet { int diamter,radius; int …

Member Avatar for hiddepolen
0
206
Member Avatar for pikalife
Member Avatar for Syrne

Hi again guys. I currently have a class named [B]ElementSet[/B] which houses an array of objects as well as an array of boolean values which pertain to two function tasked with flagging or unflagging an individual object. I also have an abstract class, [B]Element[/B], and two inheriting classes named [B]Subscriber[/B] …

Member Avatar for Syrne
0
221
Member Avatar for gahhon

[CODE]public class Fan { final int SLOW = 1; final int MEDIUM = 2; final int FAST = 3; private int speed; private boolean on; private double radius; private String color; public Fan(){ speed = SLOW; on = false; radius = 5; color = "Blue"; } public Fan(int speed, boolean …

Member Avatar for gahhon
0
227
Member Avatar for soham.m17

I want to add a selectable image to a PadDraw() of a JFrame container. So how can I do it? I've got a idea that it can be done by JLabel, but I think it's not selectable. So, how can I add that?

Member Avatar for soham.m17
0
102
Member Avatar for sha11e

The book I'm using says it should look something like this [CODE] import java.io.*; public class main { public static void main(String[] argv) { String fil = "CormeOn.bat"; FileWriter fw = null; try { fw = new FileWriter(fil); } catch(FileNotFoundException fnf) { System.out.println("Yea...."+fnf); } catch (IOException e) { e.printStackTrace(); } …

Member Avatar for JamesCherrill
0
126
Member Avatar for fausto1234

I am stuck in this code. I have to print results every 30 tosses for 500 total tosses. I made the 30 but in the loops. And also percentages are showing as 0 Help or hints would be much appreciated. [CODE]import java.util.Random;// program uses class Random public class CoinTossing { …

Member Avatar for fausto1234
0
158
Member Avatar for pavani2006

how can i check a given string to form a palindrome or not for(i=0;i<str.length();i++) { if(str.charAt(i)==str1.charAt(i) } }

Member Avatar for JamesCherrill
0
223
Member Avatar for Raghu_Ganapm

I would like to know when NullPointerException comes in java. any help would be appreciated.

Member Avatar for hfx642
0
96

The End.