python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Vertical alignment of a bottom panel
I want to vertically align 3 buttons in a bottom panel.
Here's what I wrote:
ClientWindow(){
pickBtn = new JButton();
attackBtn = new JButton();
placeBtn = new JButton();
JPanel u...
Diaskyyy
Votes: 0
Answers: 1
I want to hardcode numbers into an ActionListener without using the actual variable
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
visBoard[i][j] = new JButton();
visBoard[i][j].addActionListener(e -> playTurn(i, j));
...

The Bromie
Votes: 0
Answers: 0
The method addActionListener(ActionListener) in the type AbstractButton is not applicable for the arguments (JPanel)
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing....
Arbalistic_Cow
Votes: 0
Answers: 1
Why my frame is invisible every time I call it from the JButton?
I'm creating a Loading Page for our group project, but every time I call the loading page class, it is invisible.
Here is my Main class:
public static void main(String[] args) {
new caller();...

ashii0322
Votes: 0
Answers: 0