Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
50% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
0 Endorsements
Ranked #4K
~6K People Reached
Favorite Forums
Favorite Tags

11 Posted Topics

Member Avatar for pi_lord12

Hey guys, I'm working on a project to use Huffman trees to compress a text file into binary. For instance, based on the frequency of the characters in a string like "aardvark", a - 3 r - 2 d - 1 v - 1 k - 1, compression using a …

Member Avatar for pi_lord12
0
220
Member Avatar for pi_lord12

Hey, I'm new to Python and wondering about the following bit of code. It tells me that the module random has no attribute randint. I've looked at the documentation and such and I think I'm doing it correctly, but obviously something's wrong. Any ideas? Thanks! [code] import random int1=random.randint(1, 6) …

Member Avatar for pi_lord12
0
2K
Member Avatar for pi_lord12

I am creating a game in which I import images from files to represent characters, etc. I have created a class called Contents which represents anything that can be placed on a tile of the gameboard. A subclass of Contents (by several levels) is Wizard, to create a wizard character. …

Member Avatar for pi_lord12
0
145
Member Avatar for shahreza

Not sure exactly how your reader program is set up, but you could have it read char by char and when it encounters a space (' ') you could instead set the char equal to 0 ('0'). So, [CODE] char readChar; //The character read by the reader if(readChar==' ') readChar='0'; …

Member Avatar for shahreza
0
197
Member Avatar for dupowdis

I'm using Netbeans's GUI builder, which has a similar setup to it. I think that means that JFrameBuilder expects a method called initiateComponent() where you add anything the frame contains (panels, buttons, text fields, event listeners, etc.) and set their properties and such. This method would then be called in …

Member Avatar for pi_lord12
0
138
Member Avatar for pi_lord12

I am working my way through an online book--Intro to Java Programming by David Eck--and in it he says that it is generally considered bad style to use the getGraphics() method to draw outside of a component's paintComponent method. Does anyone know why this is?

Member Avatar for pi_lord12
-1
146
Member Avatar for pi_lord12

I'm making a JPanel for a game. I want the background to be an imported image, so I set up a ClassLoader to import the image and converted that to a URL. However, that URL appears to be null, as when I try to put the panel into a JFrame, …

Member Avatar for pi_lord12
0
156
Member Avatar for Bewitched

So to clarify... (hopefully) The '==' operator is only used with primitive variable types--int, double, boolean, etc. Strings are a type of Object; they did not "come with the system" but rather first had to be programmed in Java to define their behavior. For most objects obj, the .equals(obj) method …

Member Avatar for pi_lord12
0
180
Member Avatar for pi_lord12

So to get practice writing applets, I tried to write one that simply draws a chessboard in a 160 x 160 window. I am pretty sure I got the code right for both the html and java files, and I have the html file in the same directory as my …

Member Avatar for pi_lord12
0
119
Member Avatar for pi_lord12

Ok, so I'm trying to make a constructor for a text-based game for a monster. Here is the code for it: [CODE]public class Methods { String name; //characteristics of monsters int bodyPoints, mindPoints, attack, defense; public Monster(String name, int bodyPoints, int mindPoints, int attack, int defense) { this.name=name; this.bodyPoints=bodyPoints; this.mindPoints=mindPoints; …

Member Avatar for pi_lord12
0
2K
Member Avatar for pi_lord12

Hey, so I'm trying to make a text-based game using mostly Swing GUI; the code I have so far is below. When I use JOptionPanes I modify the icon, title, and suchlike on them, so I have about two lines of code for every JOptionPane. I created methods for them …

Member Avatar for pi_lord12
0
175

The End.