8 Topics

Member Avatar for
Member Avatar for Doogledude123

I have a custom class which extends JPanel and overrides the paintComponent() method. Here's what that looks like: @Override protected void paintComponent(Graphics g) { if(redrawRequested) { g.setColor(ETCH_BACKGROUND_COLOR); g.fillRect(0, 0, owner.getAppWidth(), owner.getAppHeight()); redrawRequested = false; } g.setColor(Color.BLACK); g.fillRect(pointX, pointY, PIXEL_SIZE, PIXEL_SIZE); } The same custom class also implements KeyListener. I am …

Member Avatar for JamesCherrill
0
420
Member Avatar for CoilFyzx

Hi. I have a JFrame with a JLayeredPane. On the first layer there is a table, then above it there is black transparent layer that allows me options and what-not. I animate the arrival of this transparent layer. However when I do this the panel seems to loose it's transparency, …

Member Avatar for CoilFyzx
0
558
Member Avatar for Benderx

Hi everyone, I was writing a program to show visually some vectors I was implementing with Java but I ran into an issue. My program has 3 classes, a driver, a Vector class and a VectorDisplay. The driver and vector class are self explanatory, but here is the code. Driver: …

Member Avatar for JamesCherrill
0
353
Member Avatar for 117

Hello, I'm trying to make a JPanel with JFrame capabilities, such as resizing, and moving, Everything seems to work fine, altough there are minor flickering inside the JPanel, I have numeral repaints and I have a method called update(), which uses absolute position to arrange Containers and Components. Whenever the …

Member Avatar for 117
0
4K
Member Avatar for Aviras

Hello everyone. I just started on 'converting' my multiplayer text RPG into a graphical form. What I am trying to do is this: Create a title window, basicly just a JPanel with one image filling the space. To this JPanel I add a MouseListener. When a user clicks the window …

Member Avatar for Aviras
0
399
Member Avatar for ashwinshenoy

Hi Guys, I have developed a program which continuously draws a circle using a timer. Now every time the circle gets displays it flickers and which is because i have used me.refresh. Is there any other way to avoid this flickering. here is my code [CODE]Private Sub Timer1_Tick(ByVal sender As …

Member Avatar for Unhnd_Exception
0
3K
Member Avatar for thes0mething

Hello everyone on Daniweb!:) I'm all new with working with swing and I'm having some problems making my paint method work:/. Atm I'm just tryin to make it write a ball, which I can control into different directions. Right now there is quite alot of unnecessary stuff in my code …

Member Avatar for JamesCherrill
0
2K
Member Avatar for DARK_BYTE

HI I am working on a project to animate user-defined algos. I am still at the very beginning but I am practicing code in swing and here is an Array class that the user can use in his user defined algo: [CODE] import java.awt.*; import javax.swing.*; public class Array1 extends …

Member Avatar for DARK_BYTE
0
226

The End.