Well I was trying to move the pad somehow
I removed the JPanel and now a loads of error popup
Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation...
Type: Posts; User: Lorack
Well I was trying to move the pad somehow
I removed the JPanel and now a loads of error popup
Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation...
arkanoidGame.java
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
I created a new method in arkanoidGame
public void actionPerformed(ActionEvent e) {
thePad.actionPerformed(e);
System.out.println("The Pad is being Called");
}
doesn't print anything...
Well in my class pad some methods are in there to make it move but they are not being called
So why if the bounds of the ball is the full screen it hides the pad?
Well you right I don't need a translucent component. I got my two object showing right now I changed the bound for theBall.setBounds(0,0,200,200) and the pad showed up because it was underneath it.
...
I understand this... The playing surface is the JPanel or the FlowLayout?
even if I do something like this :
panel.setBackground(Color.TRANSLUCENT) or
layout.setBackground(Color.TRANSLUCENT) ...
Well theBall has to go anywhere on the screen so the bounds are 0,0,800,600 which takes all the screen so I can't see the thePad
I need to set the background Translucent.. And I have no method in theBall object to do it.
Yes all draw on the same surface
Ok I got it but... I need to make the layout translucent... I changed my code a bit :
I Created objects of class ball and pad I don't really know if it's a good idea tho!
import java.awt.*;...
It's an error :
The method add(Component) in the type Container is not applicable for the arguments (void)
I'm trying to use setBounds it doesn't work I tryed to use it that way :
pane.add(new ball().setBounds(60,60,60,60));
Can i have overlapping bounds?
How can I do it then? Can I put them where ever I want them to be?
I added the drawLine() and the lines show up.
The problem is the bound of each they are not right... I tryed with the method setBounds but it doesn't seem to work
They are not showing up
I added this since :
pane.add(new ball(),BorderLayout.NORTH);
pane.add(new pad(),BorderLayout.CENTER);
I think that's why we get some random bounds...
I get the same thing
arkanoidGame.java
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
Right none of those two classes are being called
No the button is a nice size and it's at the bottom of the screen
pane.add(controls,BorderLayout.SOUTH);
No but I got a button showing up
controls.add(startButton);
startButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
panel.validate();...
in the addComponentsToPane method
Ok!, I got rid of my myFrame class I think it was pretty much useless so now I got my arkanoidGame ,pad and ball Class
I tryed the System.out.println in the addComponentsToPane and it gives me ...
Well the ball as to go anywhere....
The pad can stay at the bottom
And the bricks at the top...
3 Different Layout?