398 Posted Topics

Member Avatar for nilay84

[QUOTE=nilay84;1744098]does anyone know how to fill the JTable with the binary values such as if we have 2 variables a and b the table should be filled in as follows: a b 1 1 1 0 0 1 0 0 any suggestions would be useful.. thanks[/QUOTE] well to convert a …

Member Avatar for nilay84
0
140
Member Avatar for enterpise

[QUOTE=enterpise;1744060]Every time when i try to catch exception on the rage of my port Also the Message input box ( can't enter the negative number ) The program seems like doesn't response for my action but when i disable all the code below it will work fine Here is code[CODE]private …

Member Avatar for enterpise
0
215
Member Avatar for Newjavauser1

[QUOTE=Newjavauser1;1743989]Oh ok[/QUOTE] maybe its a UAC problem? try turning UAC off in your control panel under 'User Accounts And FAnily Safety' if it still precedes then just change your settings back. or you could right click the file you are using to parse the info to javac and click 'run …

Member Avatar for DavidKroukamp
0
208
Member Avatar for igotaquestion

[QUOTE=igotaquestion;1743927]I am working on this for hours..Your help is highly appreciated. The client will send 32 integers to the server. These 32 integers will be read from a file called DataInput.txt that is the same directory as the source of the client. I am trying to implement this delivery using …

Member Avatar for DavidKroukamp
0
1K
Member Avatar for krejar

[QUOTE=krejar;1740216]This is a mess. What I want to do is make 1 program with the 3 loops in it do something different and produce an output of what each loop does. Do loop: print out every other character For loop: print out the string reversed While loop: print out in …

Member Avatar for krejar
0
189
Member Avatar for jasonrefan

[QUOTE=jasonrefan;1743651]Hello, I am creating a basic Java program that will store music. musicID Track Name Track Artist I have chosen to do this through a text file, to store and view my data. My text file output currently looks like this: [CODE] 1 TrackName1 Artist1 2 TrackName2 Artist2 3 TrackName3 …

Member Avatar for DavidKroukamp
0
129
Member Avatar for jhamill

also see in you first for statement you are declaring the char[] letters within this statement, which can bring alot of problems so its not recommended rather declare it outside the for statement

Member Avatar for DavidKroukamp
0
452
Member Avatar for SasseMan

[QUOTE=SasseMan;1743354]Hi! I'm having some problems with my build files while running junit tests via ant. The build worked fine until a couple of days ago when I got a "process fork failed" error message. Further down in the stack trace i got: Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.6.0_25\jre\bin\java.exe" …

Member Avatar for DavidKroukamp
0
386
Member Avatar for shade399

[QUOTE=stultuske;1743329]thought of posting this as well, but he already stated that he solved it. @OP: a better way to let the community know that your problem is solved, is to mark the thread as solved. also, you could post how you solved it, so that people can refer to your …

Member Avatar for DavidKroukamp
0
144
Member Avatar for 47pirates

Hey there, hmmm well i would say take a look here and study these codes to better understand sockets and multithreaded clients and servers:[url]http://pirate.shu.edu/~wachsmut/Teaching/CSAS2214/Virtual/Lectures/chat-client-server.html[/url]

Member Avatar for JamesCherrill
0
191
Member Avatar for nickliutw

[QUOTE=nickliutw;1741519]Sorry for did not make my question clear. Now I got the compareTo method finally. You just answer my question about equals method. Thank you so much. I have another question about custom exception. I know this is out of topic, but I think I just miss a little piece …

Member Avatar for nickliutw
0
5K
Member Avatar for suraj_p

[QUOTE=suraj_p;1742751]I have to find out how many times the [CODE]createPerson()[/CODE] function is called This is my Main.java file [CODE]import java.io.IOException; public class Main { public static void main(String[] args) throws IOException{ int i; Student[] totalStudents = new Student[10]; Student.create3Persons(); Student.create2Persons(); } } [/CODE] this is my student.java file [CODE]import java.io.*; …

Member Avatar for Philippe.Lahaie
0
524
Member Avatar for battlex2010

[QUOTE=battlex2010;1736793]I am making a networking application using sockets for a local area network. How can i make the client side of the application search the network for the server socket? Right now i am getting the input from the user itself about the IP address and Port of the server.[/QUOTE] …

Member Avatar for battlex2010
0
198
Member Avatar for hbluthi

[QUOTE=hbluthi;1742085]Hey again. Trying to add elements to a DList, this happens when I try to add the second car (500, Porsche). The whole insert algorithm sucks and am strongly considering trying to figure out a better one. This is what shows up in the console: Enter name of file with …

Member Avatar for hbluthi
0
208
Member Avatar for bigredaltoid

[QUOTE=bigredaltoid;1741923]Hi guys - I need to write a program that reads in a user-input integer and tells if the number is prime or not. I've written up this code so far: [CODE]class primenumber { public static void main(String[] args){ int num = 10; int i; for (i=2; i < num …

Member Avatar for bigredaltoid
0
162
Member Avatar for karanc

[QUOTE=karanc;1742002]So Im trying to make a Coinstar Simulation and pretty much what it does is it adds up all the money and gives me a total. Im a computer science student learning java for the first time so I'm a bit confused as to what code i should put next …

Member Avatar for Philippe.Lahaie
0
301
Member Avatar for riahc3

[QUOTE=riahc3;1741909](This has to be a Java question as it simply works in a txt with a HTML extension....) I have this code: [code] <html><head><title></title></head><body> <form id='formulario' action='index.html' method='post'> <label>Ancho </label><input type='text' name='ancho' id='ancho'><br > <label>Alto </label><input type='text' name='alto' id='alto'><br > <label>Izquierda </label><input type='text' name='izquierda' id='izquierda'><br > <label>Horizontales </label><input type='text' name='horizontal' …

Member Avatar for riahc3
0
82
Member Avatar for free_dom

[QUOTE=free_dom;1741262]OK. I will research for OS depended libaries but i could not understand exactly what you mean with "You could use Runtime to run an OS specific utility to gather this information.". Can you please tell me if process stores any title or summary or something.[/QUOTE] here is a small …

Member Avatar for steve_kamlp
0
186
Member Avatar for mhd_arif123

[QUOTE=mhd_arif123;1741190]I am learning java through a book. After finishing each chapter, i work out problems given at end of each chapter . when i tried to solve a problem , i could not frame the logic exactly. Please help to solve following exercise : Write a program to find the …

Member Avatar for JamesCherrill
0
217
Member Avatar for rotten69

[QUOTE=rotten69;1739297]I was just wondering why the constructor makes a call to the method toString() then I have realised that it's because of the method's name. And why is its name so unique? I changed the name but I don't get the same results. Anyone could possible explain this please? Thanks. …

Member Avatar for rotten69
0
340
Member Avatar for friknos

[QUOTE=friknos;1740180]hi i am trying to create a dvd rental system, up till now i have entered the client's details into an array list and have created a loan for every client that rented a dvd. But now i need to edit a part of this loan, for eg i need …

Member Avatar for friknos
0
138
Member Avatar for jackbauer24

[QUOTE=thepythonguy;1739853]Here is my code: [CODE]class Catandmouse { public void CatAndMouse() { Animal cat = new Animal(); Animal mouse = new Animal(); int mouseCaught = (int) (Math.random() * 10); cat.CatchMouse(); int catgetsit = 0; if ( mouseCaught == cat.number ) { System.out.println("The cat caught the mouse!"); } else { System.out.println("The mouse …

Member Avatar for jackbauer24
0
88
Member Avatar for umair jameel

[QUOTE=umair jameel;1739883]How to print this series using loop 1,1,2,3,5,8,11,19,30,49...........[/QUOTE] Do you want to calculate the series and print it up to the nth number or have you got a set array that you want to print?

Member Avatar for DJSAN10
0
151
Member Avatar for jade_91

[QUOTE=jade_91;1739805]well basically i have this code working to display distance to nearest station and the station name but i want it to show what line the station nearest is located on i've tried to figure it out but just dont seem to be getting anywhere with it the code (including …

Member Avatar for DavidKroukamp
0
103
Member Avatar for hust921

[QUOTE=hust921;1739757]Hey everyone, i need a little help with searching a string and putting that date into another string. ex: [CODE] String com = ""; String mystring = "sometext here: !com shutdown"; // Magic happens System.out.println(com); // Output: "shutdown" [/CODE] "!com" is the constant to search for, shutdown is variable.[/QUOTE] maybe …

Member Avatar for hust921
0
132
Member Avatar for Mr.BunyRabit

[QUOTE=Mr.BunyRabit;1739724]Hey there. How do i stop this damn computer form automatically filling in my second Qoute when i make the first one " and then i have to press space for there just to appear one. It messes me around sooo badly with my programming. it does that wiht quotes, …

Member Avatar for Mr.BunyRabit
0
700
Member Avatar for riahc3

[QUOTE=riahc3;1738993]Hello Im trying to generate a image from a servlet and display it with browser. Lets say I want to do something like this: [code] protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException { BufferedImage bufferedImage = new BufferedImage(620, 420, BufferedImage.TYPE_INT_RGB); Graphics2D g2d = bufferedImage.createGraphics(); g2d.setColor(Color.black); g2d.fillRect(0, 0, 620,420); …

Member Avatar for riahc3
0
120
Member Avatar for prasanna123

[QUOTE=prasanna123;1738406]haii... I have written the code for a social networking site like orkut in php but due to guidelines given by my project guide i need to convert this code to j2EE is it possible??? i am new to j2EE can some one plzz tell me a site to learn …

Member Avatar for dmanw100
0
237
Member Avatar for iamthesgt

[QUOTE=iamthesgt;1739433]For a (homework) project, I have a class ComplexNumber that needs to be printed. I have a number of operations that can be done on objects of the class (addition, subtraction, multiplication, division). Each operation returns a new ComplexNumber to be printed. How exactly do I print this? Do I …

Member Avatar for iamthesgt
0
162
Member Avatar for BBA07

[QUOTE=BBA07;1739230][CODE] package proiect2; import java.io.*; public class Sir { static BufferedReader buffer=new BufferedReader(new InputStreamReader(System.in)); static String sir=null; public void Citire(String sir) throws IOException { System.out.println("Introduceti sirul: "); sir=buffer.readLine(); while (TestNumar(sir)==false) { System.out.println("Sirul introdus este invalid!"); System.out.println("Reintroduceti sirul: "); sir=buffer.readLine(); System.out.println(); } if (TestNumar(sir)==true) { StringToInt(sir); } } public static boolean …

Member Avatar for DavidKroukamp
0
406
Member Avatar for jackbauer24

[QUOTE=thepythonguy;1739115]Can two classes exist in a single .java file? Reply quick, please.[/QUOTE] Yes they can...

Member Avatar for jackbauer24
0
99
Member Avatar for hbluthi

i see in your for statements you are trying to transverse the array using a set length 'count'? why? and where does count get its max value because you have no setCount() nor can i see assignment to count etc? also rather use: [code]// Add next entry in order for …

Member Avatar for Philippe.Lahaie
0
196
Member Avatar for cloud02

[QUOTE=cloud02;1738865]Hi, is there anybody here knows how to store arrays in a text file? let's say the user inputs the id, name, and address and stores it on a text file then shows its output.. ex. 245656, John, 6534 Japan, Male. something like that. or anyone have a similar program …

Member Avatar for DavidKroukamp
0
168
Member Avatar for jade_91

[QUOTE=jade_91;1739097]Hi, basically ive been trying to write code to work out where the nearest station for a person is based on their current location. I did have it working to display nearest station name and distance from that station but something went wrong I must have accidently deleted something or …

Member Avatar for DavidKroukamp
0
142
Member Avatar for StephNicolaou

[QUOTE=StephNicolaou;1739133]I have solved this using an alternative method! I downloaded NotePad++, that allows you to right-click your code inserted, and has the options: Plugin commands --> Copy text with Syntax Highlighting I then paste it into word and it retains the colours, where I can easily set the page numbers …

Member Avatar for StephNicolaou
0
172
Member Avatar for ThaiAmL

read here about constructors:[url]http://www.javaworld.com/javaworld/jw-10-2000/jw-1013-constructors.html[/url] and this:[url]http://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html[/url] next here is some info on matrixes for you:[url]http://www.roseindia.net/java/beginners/MatrixExample.shtml[/url] and this should help:[url]http://introcs.cs.princeton.edu/java/95linear/Matrix.java.html[/url]

Member Avatar for DavidKroukamp
0
854
Member Avatar for enterpise

[QUOTE=enterpise;1738946][CODE]if (args.length > 0) {//this is important if no arguments where given a small help or information should pop up for (int i = 0; i < args.length; i++) { System.out.println("Argument: " + i + " " + args[i]); switch(args.length){ case '-x': ;// handle your arguments here, or set a …

Member Avatar for enterpise
0
209
Member Avatar for Razer13

[code] } catch (IOException ex)[/code] before i say much, is this your complete code? if not please post the complete code, because this to me is wrong it should be:[code] try { }catch (IOException ex) { //exception handling here }[/code] which if this is not your complete source is fine, …

Member Avatar for NormR1
0
139
Member Avatar for scheppy

[QUOTE=scheppy;1738666]Hi all I'm wondering how i add Action listener to this Button It has no text, just an image, from an ImageIcon I tried I3 for the action listener but i doesant work [CODE] ImageIcon I3; I3 = new ImageIcon ("carrier.gif"); J1 = new JButton (I3); J1.addActionListener (this); J1.setBounds (420, …

Member Avatar for scheppy
0
145
Member Avatar for timmy568

[QUOTE=timmy568;1736977]Hi guys, I was doing my project when i came across this error: Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0 at java.lang.String.charAt(String.java:686) at Screen.screenRunner(Screen.java:84) at Screen.main(Screen.java:90) I am also having problems getting my program to accept user input(height and width). [CODE]import java.util.Scanner; public class Screen { …

Member Avatar for timmy568
0
231
Member Avatar for kyriacos1986

wheres your [code]public class TestMyThread extends Thread {}[/code] and the same applies for your MyThread class it should have a [code]public class MyThread extends TestMyThread {}[/code], also try putting that in first and also try starting your thread using this:[code] TestMyThread tmt = new TestMyThread(); MyThread mt=tmt.new MyThread("Hello"); mt.start(); mt.join();[/code] …

Member Avatar for forkmartin
0
138
Member Avatar for enterpise

[QUOTE=enterpise;1738363]i want like when i put the value in any order -x123-ttcp-s-p10001 or -ttcp-s-p or whatever and then the program will execute into the port and all the method that i have What you will use to get these value into the right declaration? sorry if my english really bad[/QUOTE] …

Member Avatar for enterpise
0
204
Member Avatar for ThaiAmL

well the problem is your 'int letterToNumber(char letter)' method is declared wrong it doesnt have an opening brace '{' and the other error most likely corresponds to it not having a closing '}' and/or at line 122 no '}' brace,it should be: [code]int letterToNumber(char letter){ //work for method here }[/code]

Member Avatar for ThaiAmL
0
1K
Member Avatar for VinC

[QUOTE=VinC;275349]I'm been working through my textbook and just can't seem to understand the section on covariant return types. ie) what are covariant return types, what they are used for, etc. The definition in the book is as follows. Any explanation, link to a simple tutorial or example would be greatly …

Member Avatar for DavidKroukamp
0
158
Member Avatar for connect2abhi

[QUOTE=connect2abhi;1738051]Hi Can any one tell me how to call a subclass method from a superclass? For example: I have a class A,B and C. Now B and C extends A. So is there any way that we can call a method of B in A? Thanks Abhishek[/QUOTE] Well depending on …

Member Avatar for DavidKroukamp
0
13K
Member Avatar for sharathg.satya

[QUOTE=sharathg.satya;1737365]hi all i am facing a problem with the below code i used keylistener so that when i click letter 'v' the program has to exit. But the following code is not working. Help me please.. i think we should add listener to the code but how to add listener …

Member Avatar for stultuske
0
187
Member Avatar for krejar

you may want to check your formula:[url]http://math.about.com/od/formulas/ss/surfaceareavol_2.htm[/url]

Member Avatar for krejar
0
190
Member Avatar for rahul.ch

[QUOTE=rahul.ch;1737669]A snippet: package com.deitel.jhtp7.ch14; public class AccountRecord { ..... Doubt: 1. What does the above package statement imply. As in how(path) this AccountRecord.java will be stored? As in what folder hierarchy should I create? 2. In Command prompt I have set my Current Directory as : E:\RDL\Dropbox\Coding\Core Java\File So will …

Member Avatar for DavidKroukamp
0
244
Member Avatar for rahul.ch

[QUOTE=rahul.ch;1737198][code]public class StringBuilderConstructors { public static void main(String args[]) { StringBuilder sb3 = new StringBuilder("hello"); System.out.printf("buffer3 = %s\n", sb3.toString()); //written in textbook System.out.printf(sb3); //i tried System.out.println("buffer3=" + sb3); // i tried }} o/p: buffer3 = hello hello buffer3=hello[/code] doubt: The book says toString() gives the string representation an object. That …

Member Avatar for rahul.ch
0
237
Member Avatar for Razer13

[QUOTE=Razer13;1737529]yes i am using a swing application. i am require to store comments with the ability to add / delete comments with a timestamp on each comment which are stored on a text file. Please check your pm with further information regarding the matter. thanks in advance[/QUOTE] post your code …

Member Avatar for Razer13
0
204

The End.