Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
72% Quality Score
Upvotes Received
3
Posts with Upvotes
2
Upvoting Members
3
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
0 Endorsements
Ranked #3K
~6K People Reached
Favorite Tags
Member Avatar for kedxu

This is for anyone who might find it helpful. This template... * uses double-buffering, which can help game-makers fix that glitchy screen problem * can be exported as a runnable jar file. If you're like me and had trouble making your Applet executable, this is a possible fix. * Additionally …

Member Avatar for JamesCherrill
0
312
Member Avatar for bombay1982

Why compiler gives me error when I call object MyObject ? public class ThisIsClass { public static void main(String[] args) { MyObject loan = new MyObject(); //error should be ThisIsClass loan = new ThisIsClass(); System.out.println(loan.toString()); } } It works fine when I change name of my class to MyObject or …

Member Avatar for 1stDAN
0
168
Member Avatar for kedxu

The setSize() method of a Frame only resizes the frame itself, not the canvas inside. Is there a way to resize a frame based on what size you want the interior to be? I made this image to explain what I'm talking about: I used setSize(500,500); http://oi44.tinypic.com/4uymur.jpg I suppose I …

Member Avatar for kedxu
0
173
Member Avatar for kedxu

If I am given the exact coordinates of three vertices in image-space (as in, the numbers are not integers, but can be rounded to find their location on the screen), how can I determine which pixels are inside the triangle and should be colored? If you look at the diagram …

Member Avatar for kedxu
0
407
Member Avatar for kedxu

So I have a PrintWriter as a class variable which is created upon initialization. I want to make sure it gets closed when the Applet closes, but overriding the destroy() method doesn't seem to work (a System.out.println inside the method does not appear). 1. should I be doing this in …

Member Avatar for kedxu
0
221
Member Avatar for kedxu

Right now I know that Applets can add any listener with the addMouseListener() method. But what I want to know is if I can make my custom class a mouse listener without having an Applet add it itself.

Member Avatar for kedxu
0
92
Member Avatar for Pobunjenik

Hi everyone! So, I hereby hope to show that I've made progress in coding java (largely due to the help of this great community). I want to thank everyone for dealing with me (especially James). :) The goal: The code below is supposed to seed a layout of boats into …

Member Avatar for JamesCherrill
0
2K
Member Avatar for payal.h.narayan

Write a C# program to maintain personal information and wages of employees in an organization. The “Employee” class has different attributes like first name, last name, address, email and age as well as methods, (a) to calculate the weekly earnings (salary) of each of the employees, (b) to calculate yearly …

Member Avatar for Mike Askew
-4
178
Member Avatar for kedxu

**Does the code** int value = 5; if(value==5) System.out.println("value is 5"); if(value==6) System.out.println("value is 6"); **actually compute faster than** int value = 5; if(value==5) System.out.println("value is 5"); else if(value==6) System.out.println("value is 6"); **?** I would assume that it *is* faster, based on its name and all, but is that actually …

Member Avatar for deceptikon
0
199
Member Avatar for kedxu

An **applet** I am creating **uses Timers for its animation**. Even though the Timer is set to repeat at a constant 30ms, **the applet's framerate on my computer** versus on my brother's laptop **is significantly better**. Is there a chance that **on slower computers**, the **Timer "ticks" slower**, so to …

Member Avatar for JamesCherrill
0
870
Member Avatar for kedxu

My applet creates a new sound every time an impact occurs, which is very frequently. How come, when the sounds become too numerous, the game ceases to run smoothly? Here is the code that gets called many, many times: class soundThread extends Thread { String sound; soundThread(String i_sound) { sound …

Member Avatar for NormR1
0
233
Member Avatar for ObSys

Does a Java applet have to contain a "main" method or does it run from the "init()" method. I have written a small game in java following and example in a book however it does not tell you how to run the damn thing. Code has no erros from what …

Member Avatar for NormR1
0
237
Member Avatar for kedxu

I'm probably doing this wrong, because there has to be a way to do this. Here is my current code: import javax.sound.sampled.*; public class soundHandler{ soundHandler() { } public void newSound(String sound) { new soundThread(sound).start(); } } class soundThread extends Thread { String soundName; Clip clip = null; soundThread(String i_soundName) …

Member Avatar for ~s.o.s~
0
367
Member Avatar for kedxu

**Background**: I have some experience in programming, but it's not a lot and not very good. I'm taking my first Java class this year, but because the pace is so slow I decided to just learn with the aid of the internet. This is how I have learned most of …

Member Avatar for kedxu
0
375
Member Avatar for kedxu

I have two classes: (1) **Class A**, which extends JApplet, implements Runnable + some Listener stuff (2) **Class B**, which has a main method and is not an applet My question is, how do I create **class A** with **class B**'s main method? Is this even possible? What I'm doing …

Member Avatar for kedxu
0
246