31,001 Topics

Member Avatar for
Member Avatar for serph09

I have these three classes: Student.java [CODE]public class Student { private int grade; private String name; public Student(String n, int g) { grade = g; name = n; } public int getGrade() { return grade; } public String getName() { return name; } }[/CODE] GradeBook.java [CODE]public class GradeBook { private …

Member Avatar for ~s.o.s~
0
123
Member Avatar for oneml

Hi I am trying to create a program in java which will scan for words within a text file. The program will scan the list containing a bunch of words in every line some words may be repeated. The program should scan the text file when I input a word …

Member Avatar for ~s.o.s~
0
172
Member Avatar for sri.k

Hi all, This is sri. I've done some program to read xml elements in java.But i didnt get them in a structured way like root element and its name and child elements and their names.I am getting end tag names after tag value also.so pls help me in getting elements …

Member Avatar for sri.k
0
165
Member Avatar for Codeslinger

PLEASE MODIFY MY CODE TO COMPUTE FOR THE AVERAGE OF FIRST GRADING, SECOND GRADING, THIRD GRADING AND FOURTH GRADING PERIOD, THE FORMULA IS THIS AVERAGE COMPUTATION First Grading Period: Average = Sum of grades / Number of subjects Second Grading to Fourth Grading Period: Average = (30% of the Average …

Member Avatar for apines
0
195
Member Avatar for muncher10

I need it to read all three of the numbers and up them back least to greatest. As of right now all it prints is 0.0 for all 3 and true. How do I get it to not print true and 0.0 and print the acual numbers. [CODE]public class Floating …

Member Avatar for theonly
0
79
Member Avatar for incubus9x9

So my teacher gets mad at me when I ask questions so I'm coming here for your help cause you guys a life savers :) OK So what I understand about this project is we have a file with numbers and we have to make an array to read it. …

Member Avatar for kramerd
0
192
Member Avatar for jiraiya

Hi everyone, I'd like to write a small application to basically read in some text from a file, display it in a GUI (I've done this using a textpane), and then change the font color of certain words if they exist in the text (say from the default color to …

Member Avatar for Ezzaral
0
99
Member Avatar for Roy1287

How can I use this but not return FALSE because of decimal in numbers? [CODE]public class isNumeric { // This method checks if a String contains only numbers public boolean isNumeric(String str) { //It can't contain only numbers if it's null or empty if (str == null || str.length() == …

Member Avatar for jon.kiparsky
0
84
Member Avatar for intes77

sub class [CODE] public class Exer2 { public void setLength(int x) { this.listLength=x; } public int getLength() { return this.listLength; } int listLength=getLength(); int list[]=new int[listLength]; public void display() { System.out.println("The array length is: "+list.length+" "); } } [/CODE] main class [CODE] import java.util.*; public class Output { static Exer2 …

Member Avatar for intes77
0
148
Member Avatar for natha_peepli

i just learned how to get input from keyboard...' [CODE] import java.io.*; class Fish{ public static void main(String[] args) { BufferedReader Keey = new BufferedReader(new InputStreamReader(System.in)); System.out.println(Keey.readLine()); } } [/CODE] But whenver i compile it..its shows me the follwing exception.. C:\Program Files\Java\jdk1.6.0_22\bin>javac Fish.java Fish.java:7: unreported exception java.io.IOException; must be caught …

Member Avatar for apines
0
195
Member Avatar for amras123

for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) if (j = i) table [i] [j] = 1; else table [i] [j] = 0;

Member Avatar for Dhruv Gairola
0
86
Member Avatar for hanvyj

I'm trying to print at a resolution other than 72 DPI, I managed this using the PrinterResolution (see the code below) but I am having a problem with the printable area. When I change the resolution to 300 DPI I just print everything smaller (ie the getImageableWidth() etc are still …

0
60
Member Avatar for Son of a gun

Evening I am writing a small program to present a UI that when selecting 1 item from a drop down list then gives the user a selection of data relating to their selection. For instance if Ford cortina was selected from a list of Ford cars on screen in the …

Member Avatar for quuba
0
127
Member Avatar for hiddenman91

**I make servlet and in servlet we make dropdown menu for display names against id but when we run the servlet drop down menu created but no values displayed form database in dropdown menu so pls help me. sorry for bad english** import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.PreparedStatement; …

Member Avatar for hiddenman91
0
284
Member Avatar for rincethomas33

i want to create a menu. if i press the menuitem,then a certain action will occure.. and so on... give the details please...

Member Avatar for Dhruv Gairola
0
123
Member Avatar for Tankadin

Hi folks....I have two separate copies of this program to show how my thought process worked in initial creation and how it has changed since I was helped by you folks in my airline reservation program. It does not work but I DID try to apply what I have learned …

Member Avatar for Tankadin
0
720
Member Avatar for Dean_Grobler

Hi there, I'm getting an error saying: non-static variable MainList cannot be referenced from a static context. My snippet of code where the error is occuring: [CODE] //this method is in a class called ViewContact public void printInfo(){ int index = MainScreen.MainList.getSelectedIndex(); } [/CODE] Now the List "MainList" is in …

Member Avatar for JamesCherrill
0
124
Member Avatar for XxPKMNxX

Been asked to write a program using Cream library. We have to used Constraints, but i have no idea what they are Could someone give an explanation of one and possibly some examples?

Member Avatar for XxPKMNxX
0
81
Member Avatar for Ronik

hello sir m find a apache poi jar file what m confuse where to put this jar file so plz help me nd send a mail me procedure of use a poi jar file set class path and other details. plz send me on my mail id <snip>

Member Avatar for peter_budo
0
78
Member Avatar for Mylsamy

Hi all, I want to sent an email to user using Jav Mail API. But the email is sent without any authentication.. Can I do this? Please give the examples or Help me.. Thanks in Advance .. Myl

0
78
Member Avatar for plasticfood

i wrote a program that calculates how many coins that a vending machine splits out and such, and it does work but i can't figure how it works. at the time, i was sure of the logic, but now i can't understand how this is possible. [CODE] change = (amountPaid …

Member Avatar for masijade
0
154
Member Avatar for techieinvents

Hi Dear Danimates, I have developed one tool with the help of Swing components. Is there any possibility to convert that application into JSP.. Bcz i need that application to be in the form of Struts. So help me.....

Member Avatar for masijade
0
59
Member Avatar for plasticfood

[CODE]public static String strCap(String str){ //capitalizes the first letter of the string String newStr1 = str.replace(str.charAt(0), Character.toUpperCase(str.charAt(0))); int position = str.indexOf(". "); // looks for a period followed by a space while(position != -1){ newStr1 = newStr1.replace(newStr1.charAt(position + 2), Character.toUpperCase(newStr1.charAt(position + 2))); position = str.indexOf(". ", position+1); } return newStr1; …

Member Avatar for kola.naresh
0
89
Member Avatar for ChrisATO

Hello All, First let me acknowledge I am still fairly new to webdevelopment and this site. Thanks in advance to anyone who can help me with this issue and for those willing to try. The PROBLEM: I load into a div on index.php page via AJAX another php page. Once …

Member Avatar for ChrisATO
0
251
Member Avatar for it2051229

I am new in java swing and I created a frame... i checked the documentation API and it has this "setSize()" method.. so yeah i did set the size of my frame but everytime i run the program, it is not on the size that i have specified [CODE] public …

Member Avatar for rincethomas33
0
156
Member Avatar for jbalaji87

i have a Jframe.in order to paint it i not using paintComponent but ordinary function containing g.drawstring("sd",0,0). when ever i click the mouse the string should appear at that point and it should move with the cursor until another click appears. my problem after clicking the string is not appearing …

Member Avatar for jbalaji87
0
101
Member Avatar for agons

Hey everyone, Im working on a few java programs for a class and this one i can't seem to find an answer anywhere for. I need to write a program that roll's a dice, which is simple, then i have to have it roll the dice 20 times. Also simple. …

Member Avatar for polk230
0
2K
Member Avatar for coco24

Hey guys I need help with part 2 of my space invaders game. So far I have the missile shooting from the base but the missile is only fired once and that's it. I need to finish the code so that once the missile hits the top of the window …

Member Avatar for trogador
0
232
Member Avatar for StaticX

Hi, I have a program that has a package that is imported in a class called Control.All the files are compiling correctly apart from when I try to import a package. I am importing the package by [CODE]package carpkg;[/CODE] and in my main there is [CODE]GUI gui = new GUI[/CODE] …

Member Avatar for Gerbiler
0
148
Member Avatar for jamesze

So there's this old programming assignment from last semester and he's giving extra credit if we finish it. Here's the assignment [url]http://www.cs.oswego.edu/~odendahl/coursework/csc212/201009/assignments/04.html[/url] I really want to finish this but it's the first time my class is trying to do it without pseudo code. Here's what I have so far for …

Member Avatar for apines
0
180

The End.