Recent update: 2008-5-9

some simple questions

1643 byte By laasunde at 2008-2-11
If I declare setBounds in mainprogram class I get the correct window but the submenu's are Blocked (isnt displayed - the submens' work fine if I remove setbounds line but then JFrame is very small again)I've tryed to enter setBounds() into the XXX class but that has no effect on the size of ...

JSP page Printout

116 byte By JosephCTS at 2007-12-26
I want to take the printout of a JSP page,using Java print service API. Any help will be appreciated..

How to build data thru'put monitor?

634 byte By justatest00 at 2007-12-9
Hello Forum... To test throughput over our WAN connections, I've been asked to look into the possibility of making a client that generates packets and sends to remote host (client or server?) that accepts and reports the throughput on the remote end. UDP/TCP/IPAddress/port should be ...

Focus is getting lost from a JComboBox cell of a JTable

540 byte By aslanEa at 2007-11-23
Hi allI have a JTable whose each cell has been rendered with a JComboBox.When I select a entry from the JComboBox pop up menu, focus is getting lost from that particular cell.So problem is that user is not able to use Tab key to select the values.But behavior is OK if the JComboBox is not part ...

Function Key not work when using jre1.5

2777 byte By TomFordHKa at 2007-9-24
My application was based on JDK1.3 to develop and JRE 1.3 is using in the client side.In the application, function keys are the shortcut and it is working fine based on the above setting.Since JRE 1.5 is encouraged to be used in the future, we try to use it to run our application. But we find ...

Writing to file

897 byte By icemantja at 2007-9-23
Hi allMay I know if \n is allow for writing to file.I keep having funny output...some square representng the next line.Below is my codeimport java.io.*;class Test{public static void main(String args[]) throws IOException{PrintStream out =new PrintStream(new ...

How using sleep() method ?

168 byte By lioussaa at 2007-9-23
Hello every body and marry christmas for all :)I want to stop my program during 1 second, how can I do that and witch package must I use,thank you.

Are varargs an improvement?

55 byte By jmyrla at 2007-9-23
what are the benifits compared to passing arrays

adding zeros to a variable..

326 byte By pourbaa at 2007-9-23
I hav ea program that manipulates/works on six digit number entered by user.what i want is that if user enters less than 6 digits, program adds zeros at the end of number to make it 6 digit. like if user enters 241 program converts it into 241000 before manipulating it.which area i must look ...

proxyservice.jar

419 byte By stevenbeitha at 2007-9-23
I am having problems with IE 6.0 and very slow response from the address bar. I tried uninstalling Sun Java and it helped. But now I get a meggase eveytime I boot my (Win XP) machine that says;Windows cannot oopen this file:File: ProxyService.jar I can't seem to find any information about what ...

problem with array of TextFields

779 byte By sruj_pasa at 2007-9-22
Hi ,I have one Panel where i add array of TextFields and i added them but they are not getting added could anybody check my code and help me .., here is my code.,TextField[] textField7;TextField[] textField8;setLayout(new GridLayout(m,2));ScrollPane sp = new ScrollPane ...

who can help me! about JAVA package and java classpath's question!!!

2935 byte By christendom at 2007-9-22
有两个程序:MyKey存放目录:e:\myjava\228源代码:MyKey.javapackage kk;public class MyKey{private String name;private int age;public MyKey(String name,int age){this.name = name;this.age = age;}public String ...

Help please?

9201 byte By dannyd73 at 2007-9-22
import java.io.*;import java.util.*;class FileCopier{public void run(String inFileName,String inFileName2, String outFileName, String outFileName2){int lineCount = 0;int lineCount2= 0;try{ //open a stream on a file (bytes) FileInputStream inFile = new FileInputStream(inFileName); //character ...

Program locking up when switching DisplayMode.

1746 byte By Joroek at 2007-9-22
Hello!I came across a strange problem when tryiing to change the displaymode. The strange thing is that if works fine first run - and second and third and so on - but suddenly, without me having changed the code in any way, if freezes. The computor doesn't lock up completely - just my program. ...

Comm API "Spy Mode" ?

295 byte By OneWireRick at 2007-9-22
Hello !My app needs to listen for serial com port data traffic between a DPABX telephone system's SMDR output and a telephone system call cost accounting system in a "NON-evasive" way (Spy Mode)........does anyone have code to do this or to get me started ?THANKS !

accessing variables and methods of other classes

701 byte By dppuk04 at 2007-9-22
hi newbiei have a class that contains an array list, as well as methods for accessing and handling data within the list. The list is a list of objects created using a further class in my project.The problem is when i try to access the array list from another class or try to access methods ...

12 column jTable w/ only "one" persisting ?

844 byte By OneWireRick at 2007-9-22
Hello!.... I have an existing 12 column by 104 row jTable..... the "long" type data in this last column(index 11), "MUST" persist (be stored) "Immediately" after any change to its value ... so in the event the computer is shut off or loss of power, data in "all" rows, column index 11, can be ...

Eclipse IDE source files?

702 byte By David04 at 2007-9-22
I have the eclipse 3.1.0.When I ask to see the code from example of a Socket it tells-me:--Class file editorSource not foundThe Source attachment does not contain the source for the file Socket.class.You can change the source attachment by clicking Change Attached Source bellow.*Button saying ...

arggggh!!! why does the text keep repeating?

8205 byte By GizmoC at 2007-9-22
arrrghI am going to post some code below, please try to compile and run it yourself. Choose the "Terminal" option from the ComboBox... and you will see what I meanimport javax.swing.*;import java.awt.*;import java.awt.event.*;import javax.swing.event.*;import java.util.*;import ...

Encapsulation

343 byte By saran_en at 2007-9-22
thanks kajEncapsulation is process of hiding code and the data it manipulate -- I hope I am correct. In a website which uses java coding with encapsulation in a server side how does the data and the coding is encapsulated while the response is only a HTML. (I mean where does the encapsulation ...

Java and Xcode

476 byte By martinpaulrice at 2007-9-22
I'm anxious to learn Java and I would like to use my Mac Xcode IDE to do it. The beginning Java tutorial from Sun looks good, but it's set up for an old development environment which I can't get running using Mac OS X 10.3.5 (Panther).Does anyone know of a good tutorial or book that would ...

New to Java, Assignment Probs

3395 byte By dloj333 at 2007-9-22
Hi, I am having difficulties in this assignment. I get the loop to work correctly but I am having problems with my switch statement, or rather creating the method for it. I am assuming I have to create a method for it. import javax.swing.*;import java.text.NumberFormat;import ...

Trying to understand iterators

1972 byte By SkupperJack at 2007-9-22
Hello again world.I written this little program to try and get an understanding of iterators. I chose to use a Vector object arbitrarily.import java.util.*;public class ForumEx extends Vector{public ForumEx(){Double number = new Double(12.34);Calendar today = new GregorianCalendar();Date date = ...

Finding directory

82 byte By dgcrebbin at 2007-9-22
How can you find the directory that the user is currentley in?cheers

Manipulate files

456 byte By KhAnRoGi at 2007-9-22
Hello everyoneI just wanted to ask which classes of the JDK should I look in order to manipulate files. I mean, I want to for example open a directory, open a file, copy it, etc...For example in UNIX there are using C methods like opendir() and readdir() I can see the contens of a directory, ...

Loading ICU4J

273 byte By fifteenth at 2007-9-22
I'm new to Java and trying to evaluate the ICU4J libraries. I've installed SDK 1.4.2 and NetBeans 3.6. I've also downloaded icu4j_3_0.jar and icu4jdocs_3_0.jar. How do I install these so that NetBeans will find them?Any advice would be welcome.15th.

Runnable interface error message

2482 byte By Rojjon at 2007-9-22
Hi all,I am working through a book called Java Threads by O'Reilly. In chapter 2 there it explains how you can use a Runnable interface to overcome Java's lack of multiple inheritance. My problem is that i keep getting an error when trying to compile the code. Here is the code anyway, along ...

putting a button and its listener in JSP

1549 byte By JavHariz1980 at 2007-9-22
I have created a JSP and called TestSort to sort a String array<%@ page info="a hello world example" %><%@ page import ="sort.*"%><html><head><title>Hello,Ready to sort ?</title></head><body bgcolor="#ffffff"><%String[] strList = new ...

"Evaluating" an expression

1022 byte By MarkShute at 2007-9-22
I'm new to java, and the program I'm working on has a series of variables like this...protected int variable0, variable1, variable2, variable3; ...except there are about 100 of them.The easiest way I have found so far to update these variables is with a long series of if/else statements. What ...

Download the J2EE AVK for FREE

103 byte By DrLaszloJamf at 2007-9-22
Not again! What's that link doing on the "New To Java Technology Page"...Seesh...

ALAW Wav File

159 byte By SIVSIV at 2007-9-22
Now I want to record audio,but in my computer AudioSystem can only suport SIGHED PCM or UNSIGNED PCM,I just want ALAW . Tell me how to do ,thands

pls suggest a data structure to do this:

927 byte By cecThev at 2007-9-22
HiIm just making a simplish game to help me learn java. I have an arraylist with 8 objects, each object has 2 values:An integer value which may or may not be unique A string value which is uniqueAs the program runs different objects are put in the arraylist, i need to query the list for the ...

ACCESSING OTHER NON JAVA APPS VARIABLE...

306 byte By CompuerGeek at 2007-9-22
Is there a way to access, via java, the variable that coresponds the the value of a text box in internet explorer on a webpage, a text box in another application, like word, or anything along those lines, or does XP and OSX protect against this, and if so is there a way around this? Thanks. ...

withdraws and deposits still not working

6015 byte By naturalblond at 2007-9-22
these programs compile and run but balance is shown as 20,000.00 no deposits or withdraws// Account.java: Encapsulate Account informationpublic class Account { private int id; private double balance; private double annualInterestRate; /** Default constructor */ public Account() {this(1001, ...

mousePressed

862 byte By iRun4Fun at 2007-9-22
i've a JButton (jb1) with red (vermelho) background.I noticed that when pressed (without releasing the mouse) the background color is gray. First i changed panel and container back and foreground colors, but with no effect.Finally i introduced this code (inspired in java sun ...

Urgent!! need help understanding this code! Please help.

1893 byte By mystified_natasha at 2007-9-22
Dear allI really need understanding the following methods, it is based on a paint program. I undertsnad teh concept behind it but finding it hard to comment it. The following methods are:(1) Write/Scribble on a display area:public void scribble(int x, int y){Graphics2D g2 = ...

how to set Color for selected tab in JTabbedpane-setBackgroundAt()?

221 byte By javafan863 at 2007-9-22
How do I set the background color of a tab of a JTabbedpane when the tab is selected?setBackgroundAt( ) only works if the tab is not yet selected but returns to its default color when selected.

pre-constructor block?

1799 byte By efender1 at 2007-9-22
This code:public class Test { private String whatever; static {System.out.println("static block");} {System.out.println("what do you call this block?");} public static void main(String[] args) {System.out.println("static main");Test test = new Test();Test test2 = new Test("confused");} public ...

whats missing?

708 byte By naturalblond at 2007-9-22
Hi! I am having trouble with this program. It will not print out the square root results just the headings. What am I doing wrong?//SquareRootTable.java: Print a table showing numbers and their square rootspublic class SquareRootTable { /**Main method*/ public static void main(String [] arg) ...

missing return statement

596 byte By grand_poobah at 2007-9-22
Hello again world.I want a method that simply checks if a variable has a non-zero value.public boolean isValueSet(int x){if ( x != 0 ) return true;} This code gives me a "missing return statement" error.What's up?Thank you one and all.Ciao for now. ...

Why there is no UML tab in JBuilder X developer?

471 byte By javafan863 at 2007-9-22
I have just started to use JBuilder X Developer Evaluation edition. And to my surprise, I did not see UML tab there (I did see Source, Design, and otherthree tabs there). So is it that I did not do something right, or the software justdoes not have UML tab (A JBuilder Enterprise book did ...

Getting Largest Int From an Array of Integers

2011 byte By Seany_Eire at 2007-9-22
public class TestMe{ public TestMe(int ai[]){_numbers = ai;} public int getBiggest1(){int i = _numbers[0];for(int j = 1; j < _numbers.length; j++)if(_numbers[j] >= _numbers[j - 1] && i < _numbers[j])i = _numbers[j]; return i;} public int getBiggest2(){double d = ...

creating a Java game help please!

616 byte By louise_b at 2007-9-22
I'm trying to create a game called the SameGame, basically its a game where there's a grid of coloured blocks and if there's 3 or more of the same colour touching, then u click on them, get points and they disappear. its not an applet i'm creating, its a stand alone game, so no applets. ive ...

JPanel Scrollbar

457 byte By KhanWazeeri at 2007-9-22
Hi i have a class which extends JPanel which i use in a class which extends a JFrame.I want the Jpanel to have a scroll bar.I have used the following code but it doesn't display the scroll bar.plz help.(p is a subclass of JPanel)p=new picture2(this);p.setSize(1000, 1000);sp=new ...

Creating a Button

2735 byte By Nitish_K at 2007-9-22
Hi...I'm making an applet where i want a button and when the user clicks the button, a certain action will be perfomed...i know how to implement ActionListener's etc. but the biggest problem that has come up for me is to show the button in the area of the screen i want it to show. I made some ...

math.log problem!!!!!

424 byte By ckimseng at 2007-9-22
why my coding display output not as mine calculator answer;expected answer is 86.3436,but output from system is 52.85496494028146public double getDriverOutputWM ( ){SPL= 112+10*Math.log(0.0027);return SPL;} public String toString( ) {String str = new String( );str+="SPL= "+SPL; return str;} ...

Need urgent help with draw string method

8642 byte By Hower72 at 2007-9-22
I am having to write an applet that a user will input info into text boxes, the program then validates the info, and will store the info in an array. I need to display text boxes and the validated info in the same applet window that contains the text boxes. When I try to use the draw string ...

Calculator

10326 byte By Swalli at 2007-9-22
Hi, I'm new to the forum, as well as to Java. I need help please with my assignment,which is a calculator GUI. we've been given a program and I've managed to add to it and modify itusing another code, though I've faced some problems that I couldn't handle myself:1- I couldn't display the ...

How to make an EXE

73 byte By aryajur at 2007-9-22
How can I make an EXE file of the Java program I have made?

vector? what for?

191 byte By Talal_S at 2007-9-22
hello people,I keep reading here and there about vectors...can someone give me a bried explanation about vectors and where they are used mainly?thanks,Talal