Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
0% Quality Score
Upvotes Received
0
Posts with Upvotes
0
Upvoting Members
0
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
0 Endorsements
~16.0K People Reached
Favorite Forums
Favorite Tags
c x 65
java x 32
c++ x 28
Member Avatar for degamer106

Hmm I was lookin through a recursion program in this book i have here and the only thing I'm having trouble with is the modulus operator. I know that it returns the remainder of 2 numbers. But, suppose I have this: x % y If x > y then the …

Member Avatar for Shankye
-1
241
Member Avatar for degamer106

Let me explain what I'm supposed to do first. My assignment is to take text from a dictionary entry and display it in my client area. This dictionary entry contains characters like \ " ' and text that's written in Greek. There is an image in the upper left hand …

Member Avatar for LizR
0
109
Member Avatar for degamer106

Hi, In on of the lecture notes that was given to me by my prof, I was told that setting the ResizeRedraw value to true would allow whatever I drew on the form to be, well, resized. However, it does not seem to work. Here is my code: [CODE]using System; …

Member Avatar for LizR
0
200
Member Avatar for degamer106

When I add buttons to a panel, the buttons seem to take a huge amount of space. How do I get rid of the space? For example: [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Tester { public static void main(String[] args) { JButton dayButton = new JButton("Day"); JButton …

Member Avatar for jwenting
0
179
Member Avatar for degamer106

Ok, I looked in the API and was able to create the scroll bars. Problem is, I can't make them scroll, even though the parameters I passed in explicitly said to have the bars around. What I'm trying to do is to create a scrollpane around a JComponent object that …

0
88
Member Avatar for degamer106

Suppose I have a week that begins with Sunday and ends with Saturday (so UMTWThFS). How do I get the date for each day of the week if, lets say, we use this month and year? I looked in the API but I wasn't sure what to extract to make …

Member Avatar for masijade
0
174
Member Avatar for degamer106

I'm having a little trouble trying to nest two component classes (both extend JComponent) together. When I create the frame in my tester file, instantiate each class, and try to add both of them to the frame, it doesn't come out correctly. For instance, I want my frame to display …

Member Avatar for masijade
0
136
Member Avatar for degamer106

1) How do I tell if I have java 5 or java 6 installed? 2) I have my program commented using javadoc syntax. However, when I run javadoc from the command prompt and then open the html files, I do not see any documentation. What am I doing wrong? For …

Member Avatar for javaAddict
0
100
Member Avatar for degamer106

I'm almost finished with this program but the problem I'm having is with freeing the memory I allocated. Particularly in the area where I have pointers to strings. [CODE]#include <stdio.h> #include <string.h> #include <stdlib.h> /////////////// user defined data ///////////////////// struct State { char * name; // state name int year; …

Member Avatar for John A
0
96
Member Avatar for degamer106

The problem is that I have an ArrayList which stores objects that contain a Shape (actually a Composite shape like a Car) and (x,y) coordinates. Suppose I'm supposed to retrieve each object and the coordinates for drawing. My question is, how do I draw an Shape on the screen at …

Member Avatar for darkagn
0
101
Member Avatar for degamer106

I'm trying to put all the buttons (and their icons) into a single class. However, when I try to draw just one button in a frame, it doesn't show up. I can get it to be displayed if I instantiate the button in the same class as the Frame, but …

Member Avatar for javaAddict
0
116
Member Avatar for degamer106

I'm stuck trying to figure out how to update the text field after I click on the button in the GUI. The number of roaches is supposed to be updated each time I click, but I can't seem to find the right tool for the job in the APIs. RoachPopulation.java …

Member Avatar for javaAddict
0
114
Member Avatar for degamer106

This is a relatively simple program but for some reason, I can't compile it. I'm pretty sure the code is correct and working. My compiler keeps saying that it cannot find a constructor matching a HourlyWorker constructor when I instantiate a HourlyWorker object. I've checked and rechecked the code (in …

Member Avatar for masijade
0
178
Member Avatar for degamer106

I did a quick search on the forums and there was another problem similar to the one i'm trying to solve. I'm supposed to use the first word of a sentence as a search parameter and check the rest of the string for occurences of the word. If the word …

Member Avatar for aikem-un
0
1K
Member Avatar for degamer106

So we're supposed to modify this class, which implements Comparable, so that it accepts any type of object. The Comparable interface contains the method signature for compareTo, which I need to implement. What I'm uncertain of is how to implement this method. I know that compareTo is supposed to return …

Member Avatar for degamer106
0
84
Member Avatar for degamer106

So here's the problem [QUOTE]Write a program that asks the user to input a set of floating-point values. When the user enters a value that is not a number, give the user a second chance to enter the value. After two chances, quit reading input. Add all correctly specified values …

Member Avatar for degamer106
0
187
Member Avatar for degamer106

I'm supposed to design a method that takes in a double value and translates the value into the closest letter grade. 4,3,2,1,0 denote A, B,C,D,F, respectively. + increases a grade's numerical value by 0.3 and - decreases a grade's numerical value by 0.3. There is no F+ or F-. A+ …

Member Avatar for Mouche
0
73
Member Avatar for degamer106

Ok, so my goal is to draw a rectangular spiral in java. So far, I've created the Spiral Viewer class and the SpiralComponent but I'm not quite sure how I would implement the SpiralGenerator class. Here's what I have: SpiralViewer: [CODE]import javax.swing.JFrame; /** Test driver for Spiral class. */ public …

Member Avatar for degamer106
0
2K
Member Avatar for degamer106

I'm trying to get this ISBN checker to work. I've used the formula from this [URL="http://mathworld.wolfram.com/ISBN.html"]site[/URL] and also this [URL="http://en.wikipedia.org/wiki/International_Standard_Book_Number"]site[/URL] and it seems to work fine [B]except[/B] for the ISBN of my Java book. When I compute my book's ISBN (0131496980), it is apparently invalid. I have tried the other …

Member Avatar for jwenting
0
182
Member Avatar for degamer106

I was a little confused by the brief explanation that my Assembly teacher gave on pipelining. I don't think I really understand the process that well... 1) In a 4-stage non-pipelined processor, how many clock cycles does it take to execute 3 instructions? Assume each stage takes 1 clock cycle. …

Member Avatar for degamer106
0
84
Member Avatar for degamer106

One of the things that's been confusing me so far is why we have to override the paintcomponent() function after extending it. For example, this program draws an ellipse: [CODE]import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; import javax.swing.JComponent; public class DrawEllipseComponent extends JComponent { public void paintComponent(Graphics g) { …

Member Avatar for Ezzaral
0
97
Member Avatar for degamer106

Hi, I need help with drawing an ellipse that is bounded by the window it is drawn in. I have to use the Ellipse2D API. Maybe I'm overlooking something but I can't seem to get the circle to fit the window. This is what i have so far: [CODE]import java.awt.Color; …

Member Avatar for Ezzaral
0
129
Member Avatar for degamer106

If I do a public inheritance and the member data in the base class I'm deriving from is protected, is the only way to access the data in the base class via member/friend functions of the derived class?

Member Avatar for John A
0
90
Member Avatar for degamer106

Hi, I can't get the following code to work. I have my converting constructor (second line) to change an int type to a car type but my compiler says there's something wrong with the overloaded + operator. It says here in my book that if I want to do an …

Member Avatar for ~s.o.s~
0
96
Member Avatar for degamer106

How do i dereference a pointer to something in a class without having to write another function to dereference it for me? For instance in this code: [CODE]class Fraction { public: Fraction(int left = 0, int right = 1); Fraction(Fraction & obj); ~Fraction() { delete fl; } double getFraction() { …

Member Avatar for thekashyap
0
76
Member Avatar for degamer106

The problem I'm having is with overloading the >> operator so that I could read data from a file directly into a class's member data. Everytime I run through the program, it just crashes. when I look through the debugger, it brings me to some page of crazy code. So …

Member Avatar for degamer106
0
117
Member Avatar for degamer106

I'm having a bit of a problem with function style cast with classes. When I exit the function I expect an instance of Database to be returned. This instance would then be copied into the db declared in main. I've writtien a copy constructor and it works fine (tested by …

Member Avatar for Ancient Dragon
0
171
Member Avatar for degamer106

This might seem like a silly question, but how do I read in a newline char, by itself, as input? For example, if I gave the user a choice to enter a string for a new filename, or let them just press ENTER for some other choice. forgot to add …

Member Avatar for WaltP
0
4K
Member Avatar for degamer106

If I have a dynimcally allocated array of objects and each of these objects contains a pointer to a string, when I use the 'delete' function to return memory, do I have to go through each array element and free each string individually or does the 'delete' take care of …

Member Avatar for Salem
0
123
Member Avatar for degamer106

So in my class we just finished covering the topic of constructors and destructors. Now, my teacher has given us a lab where we have to create these classes and each of them must have a ctor/dtor. The problem I'm running into is..well.. it would be easier to describe in …

Member Avatar for degamer106
0
370