35,618 Topics

Member Avatar for
Member Avatar for sharathg.satya

hi all Here i am trying to a code in which the run method is not being called when the thread is started.. Can anyone help me please.. Here is my code [CODE]import java.awt.*; public class Games extends Frame implements Runnable { int x=250,y=470; Thread t=new Thread(); Games() { setVisible(true); …

Member Avatar for sharathg.satya
0
2K
Member Avatar for vinay.tmr
Member Avatar for jwenting
-1
3K
Member Avatar for riahc3

Hey I want to create a JAR library but not sure how to in MyEclipse. Im currently doing it manually using jar command but I cant seem to get it correctly The library code is: [code] public class LibAdd { public static int addtwonumbers (int a,int b) { return a+b; …

Member Avatar for riahc3
0
178
Member Avatar for wallet123

[CODE]class DoWhileDemo { public static void main(String[] args){ int count = 1; do { System.out.println("Count is: " + count); count++; } while (count <= 11); } }[/CODE] can someone please rxplain to me how does Do while statements work? and how can i use it in my program?: [CODE]public static …

Member Avatar for stultuske
0
133
Member Avatar for wallet123

im trying to do a program like this: i need to do a program like this: Automatic Teller Machine [B] Balance [D] Deposit [W] Withdrawal [Q] Quit select you OPtions: once i have chosen an option then i should proceed here if i choose b: YOur Balance is __ if …

Member Avatar for wallet123
0
97
Member Avatar for xxvicoxx

Hello guys well I have been working in this arraylist that is now driving me crazy! Bascially I wrote a CAR class which has some methods in it, however now I created an arraylist so it could store cars from the other class and at the same time have access …

Member Avatar for jeff-fisher
0
1K
Member Avatar for ajacintha

I am new to Java Swing, I have created a JFrame which should get displayed when there is mouse focused over it and should be hidden when the mouse is not over it. Should i add a window listener for it.

Member Avatar for JamesCherrill
0
220
Member Avatar for saideepak89

hi .... During the 64 kbps testing some of the pages in my web app ,it is taking so much time and those are need to be optimized.. i already have a jar tool to compress the js files though they did not decrease the loading response time if u …

0
77
Member Avatar for adarshcu

Hi, I'm not quite sure if there is a thread for Eclipse related query separately. But since this is a java related one. I'm posting it here. Is it possible that i can have PMD check run on a project by default ? Instead of clicking on my source file …

Member Avatar for DavidKroukamp
0
141
Member Avatar for ajacintha

I have created a frame , which cannot be maximized , but i want to make the frame non drag gable, want the frame in fixed position.

Member Avatar for dmanw100
0
84
Member Avatar for rhfh

Hi everybody, Good morning...need to ask some question.. Below is my code for the cinema booking system. [code] import java.util.ArrayList; import java.util.Hashtable; import java.util.Scanner; public class CinemaBooking { final int rows = 7, cols = 4; char[][] seats = new char[rows][cols]; ArrayList<String> reservedSeats = new ArrayList<String>(); public static void main(String[] …

Member Avatar for mcriscolo
0
174
Member Avatar for Empireryan

Greetings all. I'm preparing for my java data structure/algorithms class and I'm starting a personal code repository of sorts and such. I started out with c++ and my question is this: I'm implementing a controller class and a class full of sorting and search methods in java. Instead of copying …

Member Avatar for dmanw100
0
2K
Member Avatar for sirlink99

I have this line of code (repeated with a bit of change) [CODE] if (ropeChosen == 1){ g.drawImage(rope, 321, 0, 10, 505, this); g.drawImage(rope, 521, 0, 10, 704, this); g.drawImage(rope, 721, 0, 10, 703, this); g.drawImage(rope, 921, 0, 10, 702, this); if (p.idol2){ g.drawImage (idol, 275,485,100,100,this); }else{ g.drawImage (snake, 300,505,50,100,this); …

Member Avatar for sirlink99
0
110
Member Avatar for curtissumpter

[code=java] final String cardListStrings[] = {"First Card", "Next Card", "Previous Card", "Last Card"}; cardList = new JList(cardListStrings); cardList.setVisibleRowCount(4); cardList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); cardList.addListSelectionListener( new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { System.out.println("Inside List Event Handler"); if (cardList.getSelectedIndex()== 0) { cardManager.first(deck); System.out.println("First Card"); } if (cardList.getSelectedIndex()== 1) { cardManager.next(deck); System.out.println("Next Card"); } if (cardList.getSelectedIndex() …

Member Avatar for DavidKroukamp
0
225
Member Avatar for boris90

I need a user to input int and get the name of the month in return. I have this: [CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package se211.dz14; import java.text.DateFormatSymbols; import java.util.Scanner; /** * * @author Boris */ …

Member Avatar for DavidKroukamp
0
1K
Member Avatar for riahc3

Hello I'm tring to declare a BinaryOut type of object in a Java web project but it doesn't seem to work. I've imported the same libraries I used in a standard Java project so I don't know what's wrong. Any tips????

Member Avatar for riahc3
0
184
Member Avatar for warlord902

I have a static class, with all methods and fields static. My methods in that class are going to use a static field declared in that class. I want that static variable(which can not be made final) to be initialized with a value taken from a database when that static …

Member Avatar for warlord902
0
216
Member Avatar for pseudorandom21

Is there a simple way to get a list/array of all the predefined colors? (without listing them all individually) ? It seems as though the colors are properties of the class "Color" rather than an enumeration.

Member Avatar for JamesCherrill
0
584
Member Avatar for warlord902

I have a kind of doubt, suppose I have a class like this: [CODE] public class AA{ public static createUser(String a, int b){ User usr=new User(a,b); BB.storeUser(usr); } } [/CODE] Now, if multiple threads call this createUser() method of this class at the same time, will it cause any kind …

Member Avatar for warlord902
0
189
Member Avatar for wallet123

HI im a student and our professor asked us to convert a number into word: example: input= "1" output="one" i need to have numbers from 1-10,001 so my program will end up very long if i only use if else statement i know that there are other methods other than …

Member Avatar for wallet123
0
707
Member Avatar for _neo_

Hi folk. Can I use join() method in implementation of run(), like this: [CODE] public class MyThread extends Thread { @Override public void run() { int timeout = 30000; // here is some heavy work join(timeout); } } [/CODE] Is above thread terminated after timeout milliseconds if task takes longer …

Member Avatar for _neo_
0
296
Member Avatar for Whilliam

I'm making a calculator program but I'm stuck somewhere. I'm still new to J2ME. So guys, please take it easy on me. :). I've been trying to find the error for 4 hours now. I think the problem is, x won't retain the value.. anyway, here's the full code. [code="java"] …

Member Avatar for NormR1
0
146
Member Avatar for dennysimon

Hi all when I run commend : "C:\LJava\project\KTest2>java -cp .;org.freixas.jcalendar;.\build components.KTest2" my code runs well I then made a jar file with the command "C:\LJava\project\KTest2>jar -cf KTest2.jar .\build\components\*.class" my MANIFEST.MF 's content is : Manifest-Version: 1.0 Created-By: 1.7.0 (Oracle Corporation) Main-Class: components.KTest2 but when I run command "C:\LJava\project\KTest2>java -jar KTest2.jar" …

Member Avatar for dennysimon
0
182
Member Avatar for mohamed moamen

I want to create a JFrame and add panel to it ,the problem in drawing line in this panel [ICODE] package panel; import java.awt.Graphics; import javax.swing.JFrame; import javax.swing.JPanel; public class Main { public static void main(String[] args) { JFrame window = new JFrame(); window.setSize(200, 200); window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Graphics g =null ; …

Member Avatar for mohamed moamen
0
1K
Member Avatar for avinash_545

Hi everyone. I am currently working on a small project, where I have to interface an ERP (OpenERP) with another system (SugarCRM). For that, I am going to make use of the middle-ware Mule ESB, and to retrieve the ERP data, I will make use of a Java EE 6 …

Member Avatar for avinash_545
0
172
Member Avatar for thanatos1

Hey guys, I'm making a little pokemon game in java and i've come across a problem. The basic algorithm i use for movement is as follows: - if the player has pressed a particular key set the speed(float) accordingly (if key stroke was up, X speed should drop (since i'm …

Member Avatar for JamesCherrill
0
185
Member Avatar for hsmroz

can any one help me wright the code for any simple java games, choose one from the selection below plsss (using jav -Base Conversions -Lotto 649 -Mastermind -Hangman -Deal or no -Deal -Who Wants to be a Millionaire -Card Games -Theatre Seating -Morse Code Instant/Fortune Teller -Pay Stubs -Educational Game …

Member Avatar for Ezzaral
-1
741
Member Avatar for AlexTrott

Hello, I'm hoping you guys can help. I have a double linked list, and i am trying to add a bubble sort to it,I am really new to java, I've been able to do a bubble sort with great easy whilst using binary trees, but now i'm using a double …

Member Avatar for JamesCherrill
0
386
Member Avatar for JavaPrograms

Alright, so basically I have this program going, it reads the text file perfectly, I also have some arrays created. Now I need it to store each team's rebounds, assists, and points separately. From there I need to get the mean, median, mode for each section (which will be completed …

Member Avatar for JamesCherrill
0
176
Member Avatar for boris90

Hi, this is my first post here, and I really need some help with my homework. I'm a newbie to Java programming, and I have this assignment: [I]Write an application which reads data from a file about certain items (one row - one item, stored are the integer valued code, …

Member Avatar for DavidKroukamp
0
279

The End.