32,199 Topics

Member Avatar for
Member Avatar for hwoarang69

i want to how when is my player is jumping, statding, or falling. for some reason it only goes in fall == true if statment. in my paint method iam printing different images. bc testing what is player is doing. i have main_class and player_class. //in player class public void …

Member Avatar for NormR1
0
243
Member Avatar for Tomi1988

I give the value of three reference types (Integer,String,List) to a function to change it. But only the value of List changed, but Integer and String are reference types too. Why can't I change their values too? public static void main(String[] args) { Integer i = new Integer(1); String s …

Member Avatar for JamesCherrill
0
236
Member Avatar for julm

I am writing a java program that solves for program complexity using Halstead metrics. I just want to know what java keywords are considered "Operators" and "Operands" in halstead metrics. Any help from you guys will be appreciated...

Member Avatar for dansm88
0
911
Member Avatar for oateye

I am working on a minesweeper project and everything is working fine EXCEPT for when you click on a cell and it contains a 0 (no mines around it) and it is supposed to open all the other "0" cells around it using recursion. Right now, I keep on getting …

0
290
Member Avatar for gaurangj

import java.io.*; import java.io.Reader; import javax.servlet.*; import javax.servlet.http.*; import org.w3c.dom.*; import javax.xml.parsers.*; import java.net.*; import org.xml.sax.*; public class HelloWorldExample extends HttpServlet{ public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{ response.setContentType("text/html"); PrintWriter out=response.getWriter(); URL url=new URL("http://cs-server.usc.edu:10724/my1.php"); URLConnection urlConnection=url.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())); String xmldata; while ((xmldata = in.readLine()) …

Member Avatar for NormR1
0
172
Member Avatar for taylor.mitchell.353

I have been working on this method for six days without any luck. I should have talked to you earlier. This method is from the book, but it only is deleting California. I cannot figure out why. I tried a couple different methods(recursive and others) and none of them worked. …

Member Avatar for NormR1
0
217
Member Avatar for funtoosh

I'm trying to load an image in an Applet.The code goes fine and the Applet Window starts but it just gives a blank window instead of showing the image.I put the html file,.class file and the image file in the same directory.Can u figure out where I went wrong?? Here's …

Member Avatar for shanker31
0
1K
Member Avatar for Aninda

Iam trying to implement ternary tree in java but i have got exception in printnode method..i couldnot figure out the exception it will be great help if any one help me to figure out this Thanks in advance here is the the code exception Exception in thread "main" java.lang.NullPointerException at …

Member Avatar for NormR1
0
188
Member Avatar for crownedzero

I see this example frequently and thought I'd give it a shot but I've got something unexpected happening with my Queue. I have multiple threads utilizing my producer class but the output doesn't show that it is being written to by each thread. protected Queue<ProductMessage> prodQueue = new ConcurrentLinkedQueue<>(); @Override …

Member Avatar for ~s.o.s~
0
278
Member Avatar for WDrago

All, I am working on a simple program that reads temperature, humidity, and dew point from a sensor and logs the result to a .csv file. I am using netbeans and using alt-enter to surround code with try-catch whenever netbeans suggests. The result is pretty ugly and I can't imagine …

Member Avatar for WDrago
0
1K
Member Avatar for hwoarang69

AffineTransform tx = new AffineTransform(); tx.translate(0, 100); tx.rotate(233); tx.setToRotation(34, 333, 333, 222); g.drawImage(player_image, x, y, x+width, y+height, 50*(int)frame, 147, 50*(int)frame+50, 189 ,Sprite_Sheet.m1); not sure what iam doing wrong. this code below just display image g.drawImage(player_image, x, y, x+width, y+height, 50*(int)frame, 147, 50*(int)frame+50, 189 ,Sprite_Sheet.m1); now how can i flip it …

Member Avatar for JamesCherrill
0
116
Member Avatar for KRUX17

Hello, I'm having trouble with the ArrayList add method it seems to be giving me an error in BlueJ. It say's no sutiable method found for add(int) method java.util.ArrayList.add(int,Order)... And how would I create a new object inside a method which will add the parameters to the arraylist. Thanks Here's …

Member Avatar for KRUX17
0
171
Member Avatar for hwoarang69

i create a program using java and jframe. now how can i put it on desktop so that i dont have to keep on opening eciplse to run the program. is there a way to put it on desktop with a icon. so i can click it any it will …

Member Avatar for JamesCherrill
0
272
Member Avatar for shihab2555

I have created a table named student including column stu_id, stu_name & Blood_group.I created a delete button to delete rows and I used the following code when delete button is pressed.I take input using jtextfield.But this can only delete by taking input in stu_id.But now i also want to delete …

Member Avatar for shihab2555
0
238
Member Avatar for tingwong

Hello all. For my project I have to create a snack machine with mints and cookies. So far I have gotten an array of cookies with the code below. However an interesting problem I'm having is my output: OATMEAL cookie LEMON cookie null CHOCOLATE_CHIP cookie OATMEAL cookie LEMON cookie null …

Member Avatar for JamesCherrill
0
1K
Member Avatar for tingwong

Hi everyone, I have a little problem with my code right now. For a project, we are to create a snack machine with cookies and mints using a GUI. We are given nickels, dimes, and quarters to enter in. The problem is when I enter in 1 nickel and 6 …

0
129
Member Avatar for tingwong

Hello all. So I have a little problem with my school project. We are to create a snack machine with cookies and mints and interact with it using a GUI. We click the add Mints or Cookies button to add to the 'Snack Machine' and then click buy to purchase …

Member Avatar for tingwong
0
277
Member Avatar for javaprog200

Hello, The program below selects two shapes at random from a choice of four shapes (line, rectangle, oval and rounded rectangle) and draws them onto an applet. Once six such shapes have been drawn, the screen is cleared and the above process continues indefinitely. The issue I am having is …

Member Avatar for javaprog200
1
141
Member Avatar for adams161

I have a Java application i've written, it's a chess client that i've done as a hobby project, and it has a main applicatoin window and all the windows are contained in that. I've had a number of requests from mac users that they'd like to see it converted to …

Member Avatar for JamesCherrill
0
240
Member Avatar for Ricky116

Hi folks, I have been making a marquee scroller that reads the text coming from the right to the left, so setting a JLabel's text using setText() starting with 60 spaces and one character-long substring, to zero spaces and 60 character-long substring. I've noticed that immediately, the jlabel's text starts …

Member Avatar for Ricky116
0
911
Member Avatar for shihab2555

Hi. i made a database table table and i showed it in a jframe through jtable.I want to change my column name displayed.So far i used the follwing code. private void Update_table(){ try{ String sql="select stu_id ,stu_name ,Blood_group from student"; pst=conn.prepareStatement(sql); rs=pst.executeQuery(); md = rs.getMetaData(); int columnCount = md.getColumnCount(); Vector …

Member Avatar for shihab2555
0
2K
Member Avatar for zubair khalil

this is java webservices code and please convert to C# webservices code, just change for me , i think you understand my probelm, and please do for me here is a code below , <div>import java.io.FileOutputStream; import java.io.PrintWriter; import java.net.HttpURLConnection; import java.util.Enumeration; import java.util.Properties; import java.util.Vector;</div> <div>import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; …

Member Avatar for riahc3
0
527
Member Avatar for laguardian

Hey guys! So I'm trying to create a method that takes in a list of integers into an array and prints the elements inside the array line by line. How do I print the the elements? Here's what I have so far: public class Main { /** * @param args …

Member Avatar for NormR1
0
140
Member Avatar for riahc3

Hello Im trying to do some basic FTP work. What I am trying to do is: 1: Search for a folder named "hi" in "C:". If hi exists, enter it. If it doesnt, create it THEN enter it. 2: Inside hi, count FILES and see if there is greater or …

Member Avatar for Taywin
0
481
Member Avatar for ct_hunny

hello i' trying to take out data from start time and end time from my database record..any idea how to solve it for example: 2012-09-08 12:09:33 roadA 2012-09-08 10:49:09 roadA 2012-09-08 10:39:27 roadC 2012-09-08 09:09:33 roadA if i select 10:39:27 to 12:09:33, then only 3 data will be display...

Member Avatar for aravind326
0
215
Member Avatar for challarao

Hi all, A problem asks me to create a point class,line class composing two points, a triangle class composing three lines.Also a right angle triangle and an equilateral triangle class both inherit triangle class.I did this. public class Point{ private int x; private int y; public Point(int x,int y){ //error …

Member Avatar for jalpesh_007
0
193
Member Avatar for anand01

Hi all, I know that Vector is synchronized, when I run the following program public class ClassA extends Thread{ static Vector<Integer > v=new Vector<Integer>(); public void run() { callMethod(); } public void callMethod() { System.out.println(v.size()); v.add(0); System.out.println(v.size()); v.remove(0); } public static void main(String[] args) { for(int i=0;i<1000;i++) { ClassA a=new …

Member Avatar for anand01
0
184
Member Avatar for bcassillo

Here is my code.... It is supposed to go throught this maze and can move where there are "." and blocked by "#". I keep getting an out of bounds error. Can anyone help me? import java.io.*; public class ProgramMAZE { public static char maze[][]= {{'#', '#', '#', '#', '#', …

Member Avatar for NormR1
0
195
Member Avatar for Monkey101

Mirroring is done by copying. Suppose a Picture has H rows of Pixels and W columns of Pixels and W is an even number, like W is 2N. Here N is a the whole number that is exactly 1/2 of W. How many Pixels are copied when the Picture is …

Member Avatar for NormR1
0
112
Member Avatar for Malymieczek

Hi All, For homework I had to write a "guessing game" program, which I decided to take to another level and add on the option to add names and keep a score, etc. The problem is however, That my program will not display the text "*Player* Has Won! Congratulations!". Here …

Member Avatar for NormR1
0
160

The End.