32,199 Topics

Member Avatar for
Member Avatar for Phaelax

[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 …

Member Avatar for DavidRyan
0
95
Member Avatar for itchap

[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 :) …

Member Avatar for itchap
0
112
Member Avatar for caduggins

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 …

Member Avatar for Dukane
0
161
Member Avatar for Phaelax

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 …

0
77
Member Avatar for stormz

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() …

Member Avatar for iamthwee
0
64
Member Avatar for rLh

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 …

Member Avatar for masijade
0
249
Member Avatar for Talon

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 …

Member Avatar for jwenting
0
317
Member Avatar for spacecowboy123

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 …

0
75
Member Avatar for totengtoh

/*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 …

Member Avatar for Dukane
0
87
Member Avatar for izharg

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:

Member Avatar for Phaelax
0
104
Member Avatar for javanewbie

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 …

Member Avatar for bjj
0
179
Member Avatar for sam1

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 = …

Member Avatar for DavidRyan
0
156
Member Avatar for Covinus

[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 == …

Member Avatar for jwenting
0
160
Member Avatar for Metsfan147

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; …

Member Avatar for Metsfan147
0
114
Member Avatar for Declan123

Could someone tell where the COM libraries can be downloaded, or are they only available with the EE Thanks

Member Avatar for manojdesai
0
76
Member Avatar for Talon

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 …

Member Avatar for iamthwee
0
118
Member Avatar for s_khardenavis

i am new at using threads can any one send me any program for using multithreads?

Member Avatar for Phaelax
0
131
Member Avatar for rwagnes

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 …

Member Avatar for rwagnes
0
97
Member Avatar for kararu

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?

Member Avatar for John A
0
93
Member Avatar for josephmca77

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 .

Member Avatar for iamthwee
-1
248
Member Avatar for amit_vivek59
Member Avatar for farook ahammad
Member Avatar for jwenting
0
82
Member Avatar for hjc

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 …

Member Avatar for jwenting
0
118
Member Avatar for anti_genius

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 …

Member Avatar for s_khardenavis
0
137
Member Avatar for zouyu1983

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 …

Member Avatar for farook ahammad
0
104
Member Avatar for anti_genius

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

Member Avatar for iamthwee
0
77
Member Avatar for George2

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

Member Avatar for jwenting
0
97
Member Avatar for the jaguar

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 …

Member Avatar for Dukane
0
373
Member Avatar for Soulstryker

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 --> …

Member Avatar for Infarction
0
236
Member Avatar for Hello!

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 …

Member Avatar for Infarction
0
158

The End.