32,204 Topics

Member Avatar for
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
Member Avatar for coco24

I am confused on how to get my x and y coodrdinates to overalap. Can you please help me or give me an example of how to do so. This is the code that I have so far: [code] public boolean hitBy = true; public boolean hitBy(Bullet b) { // …

Member Avatar for Gerbiler
0
72
Member Avatar for Goyle

Hello, im having some trouble with my java assignment. The Q: [I]Write a program which will test that a dice is random, i.e. that it is equally likely that any number will appear. E.G The program simulates throwing the dice 6,000 times. The one appears 1003 times, the two, 996 …

Member Avatar for apines
0
138
Member Avatar for daudiam

gedit uses UTF encoding. Therefore, if we store binary data in the file (like through DataOutputStream's writeInt() or writeByte(), etc.), gedit would rightly complain, but if we write something through the writeUTF() function, then gedit should be able to open it as the data is written is UTF which it …

Member Avatar for daudiam
0
134
Member Avatar for daudiam

Using a BufferedInputStream is useful because it cuts down on read system calls. But the same effect can be produced, say in reading a file, if we use FileInputStream's read method that takes a byte array as input. A lot of bytes are read in a single call. Am I …

Member Avatar for daudiam
0
248
Member Avatar for hannon565

Am having bit of writiers block about how to fix this error. Its a assignment for college so am really just looking for tip or pointer in right direction. Its a simple card game similar to poker. Card.java [CODE] package pokerpkg; public class Card { //Codes for the suits public …

Member Avatar for quuba
0
201
Member Avatar for subrat_p

[CODE]public class examination extends javax.swing.JFrame { public Connection con; public Statement stmt; public ResultSet rs; public String sname,sid,sub; /** Creates new form examination */ public examination() { welcome wl=new welcome(); String stname=wl.regdno.getSelectedText(); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:exam"); Statement stmt=con.createStatement(); ResultSet rs=stmt.executeQuery("SELECT * FROM student where sno='"+stname+"'"); while(rs.next()) { sid=rs.getString(1); sname=rs.getString(2); } …

Member Avatar for javaAddict
0
321
Member Avatar for hazeeel

Hi guys! I need help here, When ever I write onto my text file, i get null and then the value.Please help me! I don't want the "null"! Here is how it looks like in Notepad++: null1: 0.22056311934213296 2: 3.017771771149946 null3: 1.508399104807777 4: 0.07575171145562612 null5: 5.187081012091999 6: 2.049001095182013 null null …

Member Avatar for hazeeel
0
4K
Member Avatar for mementomori

Hi all I'm new to JMS, im setting up a pilot project, and I'm making use of this tutorial - [url]http://javadude.wordpress.com/2009/01/03/tutorial-starting-with-glassfish-and-jms/[/url] The tutorial is for Glassfish version 2 and JEE version 5, but im using Glassfish version 3, and JEE version 6 now when i try to deploy the project …

Member Avatar for ~s.o.s~
0
280
Member Avatar for DARK_BYTE

HI I am working on a project to animate user-defined algos. I am still at the very beginning but I am practicing code in swing and here is an Array class that the user can use in his user defined algo: [CODE] import java.awt.*; import javax.swing.*; public class Array1 extends …

Member Avatar for DARK_BYTE
0
226
Member Avatar for subrat_p

Hello friends, I have a problem about JLabel I want to insert a data from database into my JLebel.setText() method.Please help me

Member Avatar for javaAddict
0
64
Member Avatar for Yutxz

Hello! I'm trying to solve this problem and I've been at it for hours. [I]Write a method called handScore that takes an array of cards as an argument and that adds up (and returns) the total score. You should assume that the ranks of the cards are encoded according to …

Member Avatar for apines
0
249
Member Avatar for keanoppy

[CODE]image = new JLabel(new ImageIcon("C:\\Users\\user\\AutoTextSum\\src\\autotextsum\\newImage.JPG"));[/CODE] As you can see from the instantiation on the label above, I've used a static file referencing whereby I explicitly indicates the physical location. Let say this coding file name is autotextsum.java. How do I put the image without the need to explicitly indicates the …

Member Avatar for JamesCherrill
0
175
Member Avatar for fender422

I completed a homework given by my instructor, but it is not doing what it's suppose to do completely. I was able to add a message in the pixel, but if I run it, some wierd characters were added after the message here's my work. I was only assigned to …

Member Avatar for quuba
0
176
Member Avatar for ladylove

Develop a car loan payment calculator. Design a GUI, using NetBeans GUI Builder, to enter price of car, down payment, interest rate, and length of loan in years. Your bank only offers 3 interest rates 5%, 10%, and 12% based on credit rating. Use grouped radio buttons to select between …

Member Avatar for javaAddict
0
860
Member Avatar for SolidSora

I'm trying to make cars of a certain color go from one array to another. For example if I want all red cars to go to be displayed, I throw the red cars into another temporary array and they get displayed on the screen. How would I make this work? …

Member Avatar for ~s.o.s~
0
118
Member Avatar for j_cart007

Hello! Does anyone have any idea about Futoshiki Puzzle Solver. I'm new to programming and i want to make a puzzle solver in java. Any helpful reply would be regarded. Thanks

Member Avatar for jon.kiparsky
0
2K
Member Avatar for haxtor21

Hello. I am running a program form my book and i get this warning from eclipse that says: "The serializable class ColorWindow does not declare a static final serialVersionUID field of type long" [CODE]import javax.swing.*; //Needed for Swing classes import java.awt.*; //Needed for COlor class import java.awt.event.*;//Needed for event listener …

Member Avatar for ~s.o.s~
0
415
Member Avatar for Swetha Kota

hi frnds i want some small basic java projcts samples and some tips to develop a projct plzz help me..

Member Avatar for Andrew Davis 64
-3
98
Member Avatar for dennisme

Environment: eclipse I have reached a snag with finding the perfect numbers from 0 - 1000 while using methods with multiple perimeters, one project, tow classes. There is an example on this site from quite a while ago within one single class. That is in a later chapter in my …

Member Avatar for jon.kiparsky
0
350
Member Avatar for dfin19

I need help with this hw problem. Generate a 2-D array of 25 integers and initialize them all to 0. Assign the value 9 to five random locations in the array to represent your mines. Fill the remaining array locations by counting the number of mines in any adjacent squares. …

Member Avatar for hanvyj
0
2K
Member Avatar for peterwalter

THis is what I need to do...I need help with the third point [INDENT]1. Write a class OrderedList. The implementation of OrderedList must be as a linked list of Comparable elements. The list items are maintained in ascending order at all times. On this assignment, no indexing methods are allowed. …

Member Avatar for helpmehelpme
0
251
Member Avatar for printmatic

Hi again everyone. I am trying to change around this program I wrote to meet some new requirements, but getting stuck on how to do it. *Write a program that reads a file consisting of students' test scores in the range of 0-200. The students scores should be stored into …

Member Avatar for printmatic
0
2K
Member Avatar for DallasFan3

Ok, well I am now working on a new program where a program that counts the number of times a digit appears in a telephone number. And I have no idea how to even start this. Can anyone please help? Atleast try to give me a outline or something. Heres …

Member Avatar for naief
0
2K
Member Avatar for hazeeel

How do I overwrite the 7th, 8th and 9th column of the text file with new values? What can I use? [CODE] ATOM 1 N ASN A 1 12.844 -5.008 -17.071 1.00 0.00 N ATOM 2 CA ASN A 1 12.377 -4.399 -15.793 1.00 0.00 C ATOM 3 C ASN …

Member Avatar for ~s.o.s~
0
84
Member Avatar for daudiam

FileInputStream inherits from InputStream which has a mark() method which does nothing. FileInputStream itself doesn't define any mark() method. Even then, if I wrap a FileInputStream object inside a BufferedInputStream object and call markSupported() on it, it returns true. In the docs, it says that the mark() method of any …

Member Avatar for daudiam
0
629

The End.