32,199 Topics

Member Avatar for
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
80
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
193
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
149
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
87
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
285
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
124
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
727
Member Avatar for MoZo1

Hi! I'm reading COM port from under java. Like: [ICODE]new RandomAccessFile("COM1", "rw");[/ICODE] I know, it looks dumb, I would be more happy with ActiveX too... But I need the ability to adapt to different kind of systems in the future, and COM can be read as file on almost every …

Member Avatar for MoZo1
0
96
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
125
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
79
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
60
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
91
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
157
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
238
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
Member Avatar for jems5

Not so new anymore more with Java but as it gets more advanced (for me that at least) the tricks evade me. I would like to output sorted values into my GUI but two things are not happening. 1. Cannot get values to print in GUI but prints on screen …

Member Avatar for jems5
0
460
Member Avatar for Andrew Davis 64

When I compile this program it says "cannot find symbol class Method Master", but when I run it, everything is fine. [CODE] /* *Andrew Davis *Nov. 19, 2010 */ import java.util.Scanner; public class Calculator { public static void main (String [] args) { Scanner keyboard = new Scanner(System.in); MethodMaster method …

Member Avatar for Andrew Davis 64
0
208
Member Avatar for Alkaline8214

In class my teacher ran a program similar to this one. When I attempt to run this from home I get a message saying "No main classes found". I know there should be a main in the program but he ran a similar program without it. Just trying to get …

Member Avatar for Alkaline8214
0
216
Member Avatar for nitins60

hello people... simple doubt [CODE] class test { public static long testApp(long number) { return number; } }[/CODE] when i pass "45638" it returns perfectly but when i pass "23837472"; it's returning not in the range. what's the issue as long has very big value/range.. and how do i pass …

Member Avatar for nitins60
0
10K

The End.