32,204 Topics
| |
This is basically to request help with my program, as was already evident. I am a student, and an assignment asks me to "Write a method that computes the spherical distance between two points on the surface of the earth, given their latitudes and longitudes." I have written this so … | |
Hello, I have a question about the code below [CODE] // Checks the vertex a if (this.a != ((Triangle)o).a) { return false; } [/CODE] So In a method called Triangle i declared an instance variable like this: [CODE] private java.awt.Point a [/CODE] What I think this code is doing is … | |
Im running into a problem in my code and cant figure out how I can get it to restart or exit upon completion. public static void main(String[] args) { JOptionPane.showMessageDialog(null, "Welcome to Morgage Calculator", "McBride Financial INC", JOptionPane.PLAIN_MESSAGE); String princible; princible = JOptionPane.showInputDialog(null, "Step 1: Enter Mortgage Amount" ); String … | |
| Hi, Sorry for another thread. I'm trying to do matrix multiplication in Java now. Here's my code (that wont work). Please let me know if you spot anything that I should change... [code] class multiply { public static void main(String[] args) { int[][] a = {{1,2,3}, {1,2,3}, {1,2,3}}; int[][] b … |
| Hi, I'm trying to learn more about matrices in Java. I am trying to read in two integer matrices A and B, then print out the calculation for A + B, but I am getting an ArrayIndexOutOfBoundsException on line 21. Any help would be greatly appreciated. [code] class MatrixAdd { … |
I need help with this program I need to be able to type all the names and the grades then the graph of all the student will be shown but i am only able to type one student name and grade and the graph shows but i can still type … | |
I am currently a begining Java student and have some code for someone here to look at. Now according to the NetBeans program I am using to write this code there are no errors, but when I run the code I get "Exception in thread "main" java.util.IllegalFormatConversionException: f != java.lang.Integer" … | |
ok so my code displays 0 every even and odd number can you explain to me how to fix this. i have a feeling it is the displayArray. This is what dispArray should do create a method called displayArray that takes an array of integers AND an integer as parameters. … | |
I broke my foot and missed the first part of class where this was covered now I'm all confused. I have a password class and I must create within this class a static method of isValid that will accept a possible password value and return if it is valid. I … | |
Hello sir's/ma'am ,i'm new to Arrays and i got an assignment to do but i'am having a problem in arrays and how to input a String... here's my code. [CODE]import java.util.Scanner; import java.io.*; class AddressBook { public static void main(String[]args) { Scanner in = new Scanner(System.in); Scanner ch = new … | |
hi how i calculate number of space and tab from the string return by readline() method BufferedReader Class | |
what is the use of constructors in java when we can intialize objects directly | |
I am making a game, but my buttons don't seem to be working. When I click in a certain area (where the button is) a screen should pop up. It doesn't. Please help. [code] // The "VirusMania" class. import java.applet.*; import java.awt.*; import javax.swing.Timer; import java.awt.event.*; public class VirusMania extends … | |
I have an assignment where I have been asked to ask the user for input. What I am trying to figure out is if there is anyway to call and use methods of another class whose constructor requires parameters without passing them from the main class that will be calling … | |
Hi, I'm using JavaScript to parse the XML onto HTML. I was wondering if there is a way that I can limit the words output on a certain XML tag. For example, for the JavaScript to only display 50 letters (or characters) of the <content> tag in XML Thank you … | |
Hello Sir, Iam working on encryption and decryption, now am able to do encryption(DES) i.e it saving in db successfully(as encrypted) bt am failing to do decryption. wt is my doubt is while encrypting am using some secret key to encode the string(say password), that key is generating at that … | |
The first program compiles fine and is also logically corrrect but the second program also compiles but is logically incorrect!! Why???? Is there something wrong with the methods in the class???? [CODE]import java.util.*; class CashRegister{ private int dollar=0; private int quarter=0; private int dime=0; private int nickel=0; private double pennies=0.0; … | |
| Hey everyone! I'm a final year programming student doing a research project on the impact of Java compiler error messages in Natural English, with regards to better diagnosis and rectification for novice Java programmers, who use the command line to compile and execute code. One part of my project wants … |
hi, i have to read value from text file. but the problem is that text file is in the following formate vlaue1 valu2 valu3 vlaue4 value no value7 no value no = there is no value between column i have to take those value from text file and put in … | |
Hi, I'm having a problem with reading from the char , coupon, and it comes up with an error saying [CODE]Exception in thread "main" java.lang.NullPointerException at input.Main.main(Main.java:27)[/CODE] At the line which I read from the char, which is that myScan.findInLine bit, I am working from a beginning java programming book, … | |
Hi! I try the following with a [B]javax.swing.JTable[/B]: - a custom TableModel (extending from DefaultTableModel) that allows adding/deleting rows by activating a checkbox in a [B]javax.swing.JTree[/B] - a [B]javax.swing.table.TableRowSorter[/B] (since JDK 1.6) that allows sorting the rows Initially, there is no checkbox marked within the JTree. So, the table model … | |
hey i am in a great confusion plz help me out.I have done basics of c++,and now i am in a confusion that whether i should continue c++ or to start with java???? plz suggest me | |
Dear Daniweb Team, I face memory leaking problem while sending mail automatically when user advertisement expire date(i.e,26 days) was expire..Mail functionality was working when it expiry days come to 26.But it shows following error. It shows an Error Like:: pergem space out of memory leaking. I request u people past … | |
java program to swap elements of one column with another in 2x5 matrix | |
Hi I am just trying to do somthing in Java. I wrote a small programm in Java using JDBC connecting with MySql. I am using Netbeans 6.9 Here is my database structure - [B]Field Type Null Default Description[/B] pnr_no int(7) No PNR No. t_no int(4) Yes NULL Train No. t_name … | |
Hi, i have a desktop application that is developed using swing. We have created jnlp to access it from client side. But when jnlp opens, mouse not work properly. After some time it go on the top left corner. Could you give us some suggestion. Thanks in advance | |
| So my problem is that i'm trying to read a MyString that returns a new Mystring in which every digit -0123456789- has been replaced with a certain char. Ex: Blink182 ====>Blinkxxx [CODE]import java.io.*; import java.util.Scanner; //////////////////////////////////////////////////////////////////////////////// class Hw08 { //------------------------------------------------------------------------------ public static void main (String [] args) throws Exception { … |
Hi everyone, i would like to extract data from text like the following one: [CODE]........... 2011/01/12 The thread 001 title should clearly describe 2011/01/12 This describe or discussion topic. General 2011/01/12 This desc 002 nor discussion topic. General 2011/01/12 titles is 003 as 'Help Me' or 'Urgent' 2011/01/12 This describe … | |
Hello, everyone. I need help on my JAVA project. I was able to write my code, but I do not get the output that I desire. I also need to validate user input. For example, all dollar amounts are >=0. Down Payment has to be atleast 10% of total cost … |
The End.