32,199 Topics
| |
[code=java] public static final String SEPARATOR = System.getProperty("file.separator"); String code = "test.foo.bar"; String fix = code.replaceAll("\\.", SEPARATOR); [/code] I'm keep getting a StringIndexOutOfBoundsException. If I replace SEPARATOR with "[URL="http://www.daniweb.com/techtalkforums/"]\\\\[/URL]" then it'll work as I want. Is there a safe way to replace the periods with the file separator associated with … | |
[B]Hey,[/B] [COLOR=black][/COLOR] [B][COLOR=black]does anyone happen to know which method is called by the garbage collector on an object when garbage collection determines that there are no more references to the object? [/COLOR][/B] [COLOR=black][/COLOR] [B][COLOR=#ff99cc][COLOR=black]and does anyone happen to know which class contains the definition of this method?[/COLOR] [/COLOR][/B] [B]Thanks :) … | |
import java.math.*;//*loan calculator import java.text.*;//*formats numbers public class MultipleMortgageLoans { public static void main(String args[]) // ** added { // declare class variable array double mortgageCalculator1[] = new double[6]; double mortgageCalculator2[] = new double[6]; double mortgageCalculator3[] = new double[6]; double payment = loan/discountfactor; double discountfactor = discountfactor; //construct the array … | |
For awhile now, I've been using Mac to code java. Though my programs compile and run fine, I always get these errors. Using the same project to compile on windows with the same IDE(netbeans), I dont get them. I was hoping someone would be able to shed some light on … | |
Hi everyone, im doing this question: (1) Find the errors in the applet given below and re-write it after correcting the errors. [CODE] import java.awt.*; import java.applet.*; public class appError extends Applet{ String name; public void paint() { Font font=new Font(“Monospaced”, Font.ITALIC, 36); setFont(font); setBackground(yellow); setColor(red); drawstring(name); }//end of paint() … | |
Hi im new in Java. i have this case study and i don't know how im gonna do it. my professor wants me to create a menu or message box that has 3 options ex. [ 1 ] Addition [ 2 ] Subtraction [ 3 ] Exit ____________ *________ this … | |
Alright, some of you have seen me ask this before but here it is again. I am a first year java student and I need an idea for a simple but well-looking semester project. If you could give me some ideas I would be thankful. I'm not asking for you … | |
Hi All, I am new to java and am trying to display an image that i have loaded from disk in a GUI I have made by creating a class that extends Frame. I have several buttons and labels in a few different panel. All i want to do is … | |
/*please helpme! how can i get the number of times on how i attemp to get the correct answer! please help me customize my inputbox i am new to this! this is a project of mine please help:mrgreen: :mrgreen: :mrgreen: */ import java.util.*; import javax.swing.JOptionPane; public class Project{ public static … | |
hi dudes, i need an urgent response for a project at the uni. i'm looking for code which can recognize operating system tasks\actions and output it in text format. i.e when i'm clicking on "Start" button, the code will generate a text string: "Click on Start" cheers mates Izi :rolleyes: | |
All, I am having a bit of trouble displaying someting using the JOption.Pane format. I know we are not supposed to pose questions here But I am at a loss and simply do not know where to turn. I am writing this code for class. It is a mortgage claculator … | |
Hi, i am trying to write an application that uses validation check for social security number. it should allow 9 charachters. the first two and the last character should be leters and the rest should be digits. i have used for loop but it doesnt work properly. [QUOTE]int noChar = … | |
[code=java] import java.io.*; class Tokenizer { public static void main( String args[] ) throws Exception { String sample = "myfile.txt"; InputStreamReader in; FileInputStream file = new FileInputStream(sample); in = new InputStreamReader( file); StreamTokenizer parser = new StreamTokenizer( in ); while ( parser.nextToken() != StreamTokenizer.TT_EOF ) { if ( parser.ttype == … | |
I'm trying to figure out implementing the clone() method of Object. I have a class with a few data memebers that I thought I'd try it out on - a node class for a linked list. So, here's the class: [code] public class HashListNode implements Cloneable { private String data; … | |
Could someone tell where the COM libraries can be downloaded, or are they only available with the EE Thanks | |
I've got a java project in which I must replace all v's(big or small) with ag',r and replace all m's(big or small) with ssad, all g's(big or small) with jeb..w and all b's(big or small) with dug>?/. I'm stumped on what to do. I know how to normally replace chars … | |
i am new at using threads can any one send me any program for using multithreads? | |
Hi. I have a Java Applet with an assortment of buttons that is loaded onto an html web page. I would like any given button to run my ASP code which returns a web page containing results from a database query. But I can't figure out how to link the … | |
How can I link my c++ program with html/javascript code? My c++ program should have browser interface....Is cgi the only option.I dont want webserver and cgi...What else can I do? | |
hi , can anyone tell me how to read contents of a CSV file into my java string. and how to convert a CSV file to a Excel file in java . | |
I want to run my jsp page online on internet hw can run it | |
i am sure that i am way off but i will attach the problem and hope someone can point me in the right direction. thanks in advance for any help given. i am trying to created a program that will write a grading program for a class with the following … | |
Hi, I want to do that i have a fixed center point in a frame. when i enter raduis in textbox and click replot button, i want that lines are drawn originating from that center point in such a way that their end points form a circle. (As children draw … | |
Hi, guys. i'm a newbie in java world,now i confront a question about the inherite classes. [code] class Base { void f() {....} } class Derive1 extends Base { void f() {....} } class Derive2 extends Derive1 { void f() {....} } [/code] i know that if i want to … | |
Hi, Someone has an idea if we can draw a line between two points with multiple colors i.e. some part of line is red and the rest part is green. Something like that. Regards | |
Hello everyone, From the available documents from java.sun.com, I can not find rich information about this option, which is used to tune memory of JVM. Are there any samples/documents of this option, like the meaning/function/best practices of this option. Thanks. regards, George | |
I need help making a word frequency counter that also gives percentages of the amount of time the character occured. I am having trouble compiling my program. Thanks. [code]import java.util.*; public class GoodLetterCounter { public static void main(String[] args) { System.out.println("\n-This program will show how many times" + " the … | |
Hi, I have an assignment that I need help finding out how to add the commission rate for salespeople. I'm to use arrays and methods. The commission rates are as follows: $1000 -- 2999 --> 2% $3000 -- 4999 --> 3.5% $5000 -- 9999 --> 4.25% $10000 and above --> … | |
helli everyone!!...hope your all in good health...jus wondered if someone could please help me...when i try to compile this code, it says "class or interface expected" for public Bank(String bankName) i have tried, unsucessfully, to fix this but i dont understand what i have to do.... please can someone help … |
The End.