36,051 Topics

Member Avatar for
Member Avatar for Progr4mmer

when ever i try to compile/run my game in eclipse it says this [QUOTE]Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at OurGame.Board.checkCollisions(Board.java:78) at OurGame.Board.actionPerformed(Board.java:40) at javax.swing.Timer.fireActionPerformed(Unknown Source) at javax.swing.Timer$DoPostEvent.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at …

Member Avatar for Progr4mmer
0
107
Member Avatar for Neversleepin

Hi, i'm still beginner in java. Here is my simple question: if we have two java programs like: -test1.java which open a file for example. test2.java which move one file to another directory. Suppose these two programs are working well separately. if one day, we want to write just one …

Member Avatar for Neversleepin
0
162
Member Avatar for kellyslater36

Hi Enclosed is my Java assignment which is due **Tuesday**, any help would be greatly appreciated. Program Specification: (1) Rather than having the trainee type in the full title of his Training Module, let him choose from a menu: the choices should be: “Forward Scanning Radar Display Repair”, “IR Beacon …

Member Avatar for kellyslater36
0
171
Member Avatar for sj5536

hi i created text to pdf converter project in java using eclipse. when i run it from eclipse it works properly. in eclipse i used export menu to create executable jar file(runnable jar).when i run project from that jar file it actually run but it wont convert those text file …

Member Avatar for JamesCherrill
0
184
Member Avatar for infinitus

I dont know how to kill this JOptionPane pop out eveytime i do something... it just pops [CODE]Object[] options = {"Option 1", "Option 2"}; Component frame = null; int n = JOptionPane.showOptionDialog(frame, "Chose Game Option \n *Option 1 - Enter Secret Word\n *Option 2 - Random word selection from secret …

Member Avatar for infinitus
0
165
Member Avatar for coervivekmca

i need code to use my webcam for video chat ??plz help me ..and give me some idea

0
70
Member Avatar for coco24

Hi, I am trying to compare two objects, but it is not working correctly. Please help. [CODE]/** * Compares theObject with <CODE>this</CODE> object for * equivalence. Do not concern yourself with runtime * efficiency. * @param theObject to be compared with this object * @return true if theObject is equivalent …

Member Avatar for anon12
0
82
Member Avatar for gavriela

Hello, I'm a student working on my first hands-on assignment. One of the questions is this: Q4: Write a program that converts a user input temperature from degree Celsius to Fahrenheit or Fahrenheit to Celsius using: C = 5 (F -32)/9 or F = 9C/5 + 32 The user must …

Member Avatar for ~s.o.s~
0
413
Member Avatar for 3vilwyatt

So I am a bit confused with the following terms already and how they interact. I am new to IM creation and I want to know the best approach on how to go about this. Anybody can explain them to me? I know ejabberd is a kind of open source …

Member Avatar for 3vilwyatt
0
119
Member Avatar for Mabyboi

Hey guys, Im having a really hard time with this, I've been searching and trying to work at this for hours but cant get anything to work. If you guys could help it would be amazing. Essentially what I need to do is take this code thats been provided to …

0
57
Member Avatar for jrosh

I wrote a web service to connect to mysql database. But I can't find a way to call it from the j2me midlet to pass parameters to the web service. Please help me with this.

Member Avatar for jrosh
0
90
Member Avatar for Taimoor Rana

Hello Lovely People, Please have a look at my GUI first, before reading the rest (I've attached a picture, see at the end of my post). I'm having two problem with this GUI. 1) I don't want my Start button to be as long as it is. I want it …

Member Avatar for Taimoor Rana
0
180
Member Avatar for sariberri

The rubric says "In a new class, write a static insertion sort method that takes in an array of Comparable objects...In this new class, create a main that tests your code by making an array of TravelGuide objects and passing it into your insertion sort. Also test that your code …

Member Avatar for ztini
0
3K
Member Avatar for carinlynchin

okay so I have an array of buttons, and at some point in the program I want to access the index of a button clicked in order to perform some calculations....so there are two options that I can think of...maybe there is a method to pull out the index (2d …

Member Avatar for carinlynchin
0
143
Member Avatar for jbennet

How to do a HTTP PUT/DELETE? (Using jquery) . Im making a REST-ful twitter-type aplication using Java Servlets etc... and i have the methods for handling PUT and DELETE, i just need to be able to perform these e.g. when a user submits a form (with the id of the …

Member Avatar for jimforsyth
0
347
Member Avatar for black_berry

Hello, I have two classes, Help and RecylingGui. I have a button on the RecyclingGui called Help, which when clicked should open the text area created in the Help class. I added the ActionListener for this but nothing is happening. Any help would be appreciated. Thanks. The Code: Recycling Class …

Member Avatar for quuba
0
350
Member Avatar for StevoLord

Found this sniplet of code on various websites to use this way of playing a wav file however im getting this error message. javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file Update 1 - I know the wav file has to be 8khz, is there a way to …

Member Avatar for StevoLord
0
4K
Member Avatar for ramanak.24

Hi to all, i just want to know where can i get the scjp voucher and the validity as well.since i am living in hyderabad i am a employee. Is it possible to get the voucher from prometric cneters if yes, please do let me know where are these centers …

Member Avatar for ramanak.24
0
83
Member Avatar for coervivekmca
Member Avatar for peter_budo
0
72
Member Avatar for infinitus

Hello, i have came across a problem when trying to create a hangman game. I want to read a String of letters inputed from keyboard and then i want someone else to guess this word(typical hangman rules). I have used this code. [CODE]InputStreamReader FindWord = new InputStreamReader(System.in); BufferedReader in = …

Member Avatar for harsuraj
0
411
Member Avatar for zach&kody

My friend and I are in a Computer Science I class, and we are momentarily working on a project which asks you to import a method from a previously edited source, into another java source file. Here is our code. [CODE]import java.awt.Graphics; import java.awt.Color; import java.awt.Image; import java.awt.Container; import javax.swing.JFrame; …

Member Avatar for zach&kody
0
6K
Member Avatar for amrita111
Member Avatar for JamesCherrill
0
95
Member Avatar for ahmed_fawzy

Hey Guys i want to create keyUp and keyDown Events on JTable to get value at particular cell as i press up key and Down Key ,i tried to do it and succeeded in KeyDown Event which is : [CODE] ProductTable.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent k){ ProductTable_KeyPressed(k); } }); …

Member Avatar for JamesCherrill
0
183
Member Avatar for addlou

I need to write a loop to go through a string and retrieve alternate characters from index positions. Then append the characters to another string and then print (eg. "pleasehelp" = "peshl") I have hit a wall and lack any sort of know how to push through... what have I …

Member Avatar for Momerath
0
625
Member Avatar for stephy1

I got one interview question, what's the advantage of objects in java ? I surfed, surfing regarding these.

Member Avatar for Momerath
0
73
Member Avatar for lashbandi

Hi... my programs compiles and runs fine...but i still get this error..what am i doing wrong in here... its suppose to print polynomials... [CODE]import java.util.*; public class PolyTest { { public static void main(String[] args) { Scanner stdin =new Scanner(System.in); Polynomial polynomial = new Polynomial(); int coefficients; //= { 2, …

Member Avatar for JamesCherrill
0
804
Member Avatar for sanam_1

dear programmers, i need help with one of my java program. the program should ask the user to enter a sentence and the then return the number of repeated characters in a row. as a example if the user enter "myy naame is joshh"the user should return "3 repeated characters" …

Member Avatar for stultuske
0
85
Member Avatar for isamuhunter

Hello there...I need some help when I'm trying to pop data (numbers) from an array into another one (push them). I managed perfectly to input data but I'm completly lost when trying to pop from one array and push it into another one, I tried many things but none of …

Member Avatar for javaAddict
0
183
Member Avatar for EmbeddedHelp

Hi all, (Firstly please note I am a beginner programmer!). I have the following code where I am trying to print the data base entries, then the user press the space bar to add another entry, followed by the data base contents being printed again. Any pointers in the right …

Member Avatar for javaAddict
0
189
Member Avatar for terzenta

I've been messing around trying to figure out why I'm getting this compiler error for a few hours, and I'm just not sorting it out. Any help would be appreciated. Thanks, David Code: [code] package dladoucer_week5; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input …

Member Avatar for terzenta
0
242
Member Avatar for NickJoe

Hello, I've looked all over the web and can't seem to find how to do this, so I'll try here. I'm working in a program in which i need to draw shapes, specifically irregular polygons. I figured the easiest way to do this, and the one that makes the most …

Member Avatar for JamesCherrill
0
284
Member Avatar for atticusMom

I have all figured out I think except exercise 7.20 Extend zuul by adding an Class called item. Each item is created with a description such as rock or stick and a weight. When creating rooms and setting their exits, items for this game should also be created. When player …

Member Avatar for atticusMom
1
5K
Member Avatar for Newskin01

There is a great deal of information out there on printing arrays in toString() but most suggest using Arrays.toString(arr); This however prints the whole array even the nulls and is formatted a specific way. I'm looking for a way to print the values in an array that are not null …

Member Avatar for jon.kiparsky
0
2K
Member Avatar for Amoryethel

Hi, I'm writing a program that reverses the words of a text file using the LinkedList structure. Unfortunately, I have received the following error: [CODE]java.util.Scanner[delimiters=\p{javaWhitespace}+][position=30][match valid=false][need input=false][source closed=true][skipped=false][group separator=\,][decimal separator=\.][positive prefix=][negative prefix=\Q-\E][positive suffix=][negative suffix=][NaN string=\Q?\E][infinity string=\Q?\E] [/CODE] And because of that I'm having difficulty proceeding to the next step. If …

Member Avatar for ztini
0
211
Member Avatar for kukuruku

Hi,if I have array of objects {first(name,age),second(name,age)} How can I access first (name) in java Thanks

Member Avatar for javaAddict
0
172
Member Avatar for himanshu1051

[CODE] 1. int[][] board = new int[][] {{1,0,0},{0,1,0},{1,2,1}} [/CODE] please explain how we have used index here....like row and column....i know about this we have an array, a, with two rows and four columns. [CODE]int[][] a = new int[2][4];[/CODE] // Two rows and four columns. but what about the 1. …

Member Avatar for JamesCherrill
0
154
Member Avatar for Java NOOB

Hello, I am having a problum working on a project. how do I initialized a something that I do not want a varaiable to effect. [CODE]import java.lang.*; import java.util.Scanner; public class HW05_03 { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int angleInDeg; double angleInRadians = Math.toRadians(angleInDeg); …

Member Avatar for JamesCherrill
0
134
Member Avatar for Spirit_Guardian

I am trying to compile my simple java code and receive two errors. Any help will be appreciated. 1. Java1_Week2.java:19: illegal start of expression public Java1_Week2() { 2. Java1_Week2.java:19: ';' expected public Java1_Week2(){ Here is my code: [CODE]import java.text.DecimalFormat; import javax.swing.*; public class Java1_Week2 { public static void main(String[] args) …

Member Avatar for Spirit_Guardian
0
209
Member Avatar for thebigbroski

I was working on Problem 17 on Project Euler: [url]http://projecteuler.net/index.php?section=problems&id=17[/url] and I'm stuck; my answer is close, but not correct. I got the answer 21108 with the following code: I do realize the code can be optimized, but I would like to simply get this to work, and not try …

Member Avatar for thebigbroski
0
527
Member Avatar for 24x24

First off: I am not looking for somebody to do my homework. Although it would make it easier for me in the short term, please don't "help" me by writing my code for me. I would rather lose points for being late and understanding the code than get the grade …

Member Avatar for peter_budo
0
138
Member Avatar for sudiyer

hi .. i am new to jsp coding - i hav created a database using mysql workbench - it is a Graphical Interface to creating databases and tables... but the problem is that i dont know how to access my tables through jsp coding .. where should i put my …

Member Avatar for peter_budo
0
291
Member Avatar for nalbertini

Hi People, When creating this program, I am trying to add a while loop so that I can continue to pull in input from the user until they put a -1 for the input. This is the error I get. java:46: cannot find symbol symbol : variable input location: class …

Member Avatar for peter_budo
0
210
Member Avatar for StevoLord

Okey now the problem is that if the previewFrame is set to the default layout the buttons show but since it is using a layout manager the setBounds,setLocation,setSize commands dont work. So I used the code previewFrame.setLoayout(null) which would let me set my own position of the buttons on the …

Member Avatar for StevoLord
0
146
Member Avatar for Oblivious21

Hey guys and gals I need alittle help. i have an assignment that needs to print a certian number of stairs according to a user input. Example program run (user input is in bold): Please enter the number of rows: 4 Please enter the number of stars in row 1: …

Member Avatar for Oblivious21
0
165
Member Avatar for carlitosway17

Hi we are supposed to modify this class for my school project to create a code that will print out a rectangle made of asterisks * something like ********* * * * * * * * * * * ********* here is my code [CODE] // Exercise 7.21: TurtleGraphics.java // …

Member Avatar for carlitosway17
0
171
Member Avatar for dasatti

I started developing an HTML editor using Java. After spending a lot of time I am now stuck in between. Most of the things are done but now I don't find any way to implement some of very important features. [B]I think[/B] java is too weak too support these features. …

0
107
Member Avatar for zeeya

Hello.. I'm new with java and have some problem with my assignment. I want to write a class named phoneBookEntry that has field for a person name and phone number. The class should have a constructor and appropriate accessor and mutator method. Then, write a main class that create five …

Member Avatar for peter_budo
0
1K
Member Avatar for draven07

..Hi to all...just want to ask.. ..I have already created an ideal layout for my calculator..my problem is...I dont know how to insert a value into a field everytime I press a button(0 to 9)..without deleting the previous integer after I press my operator.. ..how shall I do so..??..

Member Avatar for draven07
0
97
Member Avatar for srinivasan106

is it possible to send an sms through JAVA.. My requirement is a chat application like Rediff bol. am able to do chat using networks. but can i be able to send sms. just like when i press a button called send sms then a window needs to get a …

Member Avatar for peter_budo
0
81
Member Avatar for coco24

Is this a simple way to return the number of occurrences of theValue in a bag? [code] /** * Return the number of occurrences of theValue in the bag. */ public int countOccurrences( String theValue ) { // fill in code for(int index = 0; index <= topPosition; index++ ) …

Member Avatar for javaAddict
0
80

The End.