Recent update: 2008-5-9
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 ...
I want to take the printout of a JSP page,using Java print service API. Any help will be appreciated..
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 ...
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 ...
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 ...
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 ...
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.
55 byte By
jmyrla at 2007-9-23
what are the benifits compared to passing arrays
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 ...
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 ...
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 ...
有两个程序: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 ...
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 ...
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. ...
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 !
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 = ...
How can you find the directory that the user is currentley in?cheers
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, ...
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.
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 ...
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 ...
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 ...
Not again! What's that link doing on the "New To Java Technology Page"...Seesh...
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
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 ...
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. ...
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, ...
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 ...
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 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.
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 ...
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) ...
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. ...
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 ...
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 = ...
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 ...
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 ...
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 ...
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;} ...
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 ...
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 can I make an EXE file of the Java program I have made?
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