15 Discussion / Question Topics

Remove Filter
Member Avatar for
Member Avatar for sallubhai

Hi I wanted to draw a field like this photo which I have attached. I would appreciate your help. I have wrote so much now: for (int x = 2; x < 12; x++) { for (int y = 2; y <= 12; y++) { g.drawRect(40*x, 40*y, 40, 40); } …

Member Avatar for JamesCherrill
0
299
Member Avatar for NightOwl19

Heya guys, i have been trying to make this very famous ball game using java swing. although the primary code ihave used is from this link [[Click Here](http://www.edu4java.com/en/game/game6.html)](null)but been trying to modify it to make it look less complex..But everytime i run it it gives me following error: Exception in …

Member Avatar for NightOwl19
0
511
Member Avatar for 2384443

Hi everyone, i need your help.. I want to draw a circle,square and rectangle on Jframe on a click of a button.. This program was asked in my test paper, i couldn't get it right though bt i wanna know what my mistake is.. Plz help me.. import javax.swing.*; import …

Member Avatar for JamesCherrill
0
340
Member Avatar for CoilFyzx

Hello good day. I am trying to figure out if it is at all possible for me to do but I want to access the area that is outside the JScrollPane's view when my JFrame is resized. Let me explain; I have a LayeredPanewith two layers within a JscrollPane. The …

Member Avatar for CoilFyzx
0
228
Member Avatar for CJMW

So im making an RPG. For collision detection, I thought I would do it like this: 1. Read text file containing collision data. 2. Iterate through the list using nested for loops. 3. When a value of 1 occurs (denoting an inpassable tile) add a rectangle to list 'badTiles', where …

Member Avatar for CJMW
0
411
Member Avatar for 9tontruck

I am trying to find an area center of various types of rectagles. (Center of gravity and midpoint of 4 ertices never work so please think in different way) Please see this image: http://img22.imageshack.us/img22/7881/rectangles.jpg I have to position of red dot ` Point vertices[4]; Point areaCenter; ` I have to …

Member Avatar for Moschops
0
365
Member Avatar for coutnoob

Hi again and thanks in advance ! Last question ! I have to create a class called polygon (not normal) that has in private the number of sides and the length of each side and in public that has 2 constructors (the one has as variables the number and each …

Member Avatar for Kanoisa
1
4K
Member Avatar for Hypnos_16

[I]Create a program called, Containment, that accepts three command line arguments, a file that contains a list of shapes, and a pair of numbers the specifies the (x,y) coordinates for a point. The program should print out the list of shapes, and a true/false value that indicates if the point …

Member Avatar for Hypnos_16
0
226
Member Avatar for stan2000

I'm trying to create a filled and unfilled rectangle class. I can easily create the filled, but the unfilled one is giving me a little difficulty. Whats going on? [CODE] void Rectangle::drawrec() { if (filled == true) { for (int row = 0; row < height; row++) { for (int …

Member Avatar for mazzica1
0
159
Member Avatar for begueradj

Hello people I have a JFrame which container is a JPanel: can you give me a piece of code that shows how to create a grid of rectangles ? I need this information for my poject Thank you

Member Avatar for begueradj
0
2K
Member Avatar for digan

Hi I am trying to make a program that prints a snooker board on the screen. I am trying to print the different parts on top of each other. So far all I am able to do is print the background. when i try to print the cloth on top …

Member Avatar for hiddepolen
0
382
Member Avatar for henrimontreal

Hey guys! I am new at Class and object things. Before introducing the object oriented issues my life was easier! I wrote these codes here: /*--------------------------------------------------------------------------------------- Source File: OOP4.Henri.cpp Program name: Object Oriented program, Assignment 4 Author: Hassan Aghaei Baradaran (Henri) Compiler: Bloodshd Dev-C++ 4.9.9.2 Purpose: To define and demonstrate …

Member Avatar for raptr_dflo
0
244
Member Avatar for sallubhai

Hi, I want to draw some rectangles with the same size and different colors by using an array but don´t know exactly how to do it in the for-loop. Thanks for help! [CODE]class Figure { private: int **figur; int row,col; public: Figure() : row(5), col(20){ } void allocate_place(int r, int …

0
104
Member Avatar for sallubhai

Hi, I want to draw some rectangles with the same size and different colors by using an array but don´t know exactly how to do it in the for-loop. [CODE]class Figure { private: int **figur; int row,col; public: Figure() : row(5), col(20){ } void allocate_place(int r, int c) { this->figur …

0
101
Member Avatar for batchprogram

I recently made a switch to SDL as a cross platform alternative to directly accessing DirectX or OpenGL. In an attempt to port a section of my game framework, I encounter logic errors that (to me) make absolutely no sense. In this snippet, a sprite is simply a wrapper class …

Member Avatar for venomxxl
0
204

The End.