398 Posted Topics
Re: [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 … | |
Re: [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 … | |
Re: [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 … | |
Re: [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 … | |
![]() | Re: [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 … ![]() |
Re: [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 … | |
Re: 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 | |
Re: [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" … | |
Re: [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 … | |
Re: 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] | |
Re: [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 … | |
Re: [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.*; … | |
Re: [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] … | |
Re: [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 … | |
Re: [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 … | |
Re: [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 … | |
Re: [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' … | |
Re: [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 … | |
Re: [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 … | |
Re: [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. … | |
Re: [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 … | |
Re: [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 … | |
Re: [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? | |
Re: [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 … | |
Re: [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 … | |
Re: [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, … | |
Re: [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); … | |
Re: [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 … | |
Re: [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 … | |
Re: [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 … | |
Re: [QUOTE=thepythonguy;1739115]Can two classes exist in a single .java file? Reply quick, please.[/QUOTE] Yes they can... | |
Re: 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 … | |
Re: [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 … | |
Re: [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 … | |
Re: [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 … | |
Re: 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] | |
Re: [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 … | |
Re: [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, … | |
Re: [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, … | |
![]() | Re: [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 { … ![]() |
Re: 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] … | |
Re: [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] … | |
Re: 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] | |
Re: [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 … | |
Re: [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 … | |
Re: [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 … | |
![]() | Re: you may want to check your formula:[url]http://math.about.com/od/formulas/ss/surfaceareavol_2.htm[/url] ![]() |
Re: [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 … | |
Re: [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 … | |
Re: [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 … |
The End.