32,199 Topics
| |
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) { // … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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); } … | |
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 … | |
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 … | |
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 … | |
Hello friends, I have a problem about JLabel I want to insert a data from database into my JLebel.setText() method.Please help me | |
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 … | |
[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 … | |
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 … | |
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 … | |
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? … | |
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 | |
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 … | |
hi frnds i want some small basic java projcts samples and some tips to develop a projct plzz help me.. | |
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 … | |
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. … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
Is there any program that can help me customize my GUI? Like add some color and pictures? Adding color into my Jpanel, JBotton, etc? | |
Hi there developers! I'm trying to develop my own online multiplayer game, using the DarkGDK. But I don't want everyone to have access to the media of the game, so I'm working on my own cache archive format. This is how it works: .idx0 = textures .idx1 = sprites .idx2 … | |
Here's my problem. I need to add only the first and last elements of each row, and display them separately. Ex. Row 0=11 Row 1=11 Row 2=8 [CODE]int arr[][]={{5,9,6},{3,2,8},{7,0,1}}; int sum=0; for(int row=0;row<arr.length;row++){ for(int col=0;col<arr[row].length;col++) sum=arr[row][col]+ arr[row][col]; System.out.println(sum+" ");[/CODE] this is my code, and i think i just need some … | |
How could I empty my JTable (AbstractTableModel)? If I run [ICODE]tableModel.deleteData();[/ICODE], then the message "0 >= 0" appears. Thanks! [CODE]class QueryTableModel extends AbstractTableModel { Vector cache; // will hold String[] objects int colCount; String[] headers; String url; String databasename; String login; String pass; Connection db; static Statement statement; public QueryTableModel(String … | |
[B]Any ideas on how I would could this to add the selection in each box and put it in the total charges label? [/B] [CODE] import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; /** The Main class creates the GUI … |
The End.