Skip to main content

All Questions

Tagged with
0 votes
2 answers
53 views

Java Swing: Activate an animation with an Action event

I am trying to write a simple GUI in java.switch which activates an animation when a button is pressed. The animation works when I remove the button and just let the animation run directly, but when I ...
Nico's user avatar
  • 111
0 votes
0 answers
48 views

Why ActionListener on JButton does not work in Swing in Kotlin?

I am learning Swing and Kotlin. I want to change text of the button. I made ActionListener on JButton, but when I compile Kotlin project, run by javaw.exe and click on the button, it does not change ...
Lazataknes's user avatar
0 votes
0 answers
48 views

Action Listener (JFrame) will not change the instance variable

public class YourAge extends JFrame { private static final long serialVersionUID = 1L; private JPanel contentPane; private JTextField fNameTextField; private JTextField ...
hersh's user avatar
  • 1
0 votes
1 answer
65 views

Having issues with Java swing while making a calculator app [duplicate]

I have been working on creating a calculator on and off and I am using a tutorial created by Bro Code. I was able to run it multiple times without issue but after comings back a couple of weeks later, ...
Snub's user avatar
  • 1
-1 votes
1 answer
44 views

Trying to understand why an actionlistener fires multiple times [closed]

I have an application which is much more complicated than this, but this simplified code has the same issue. The full application has 4 tabs in a tabbed pane and queries a database to update tables ...
jeskibuff's user avatar
0 votes
1 answer
49 views

declare more then one ActionListener

I'm learning GUI programming with Java right now and I'm trying to make my first owns Application. I use ActionListeners in them. My Question is if it is more effective to declare just one ...
Bootfahrer's user avatar
1 vote
0 answers
90 views

Multiple operations at same time gives 0.0 as output.Calculator using swing

I created a calculator using Java swing.Frame creation and button arrangements were all set.I used ActionListener interface.And the program were execute successfully,when i performed a single ...
Amalshanth's user avatar
-1 votes
2 answers
46 views

Why is the ActionListener not working with the buttons in Java GUI?

I'm working on a Java GUI application, and I'm having trouble getting the ActionListener to work properly with my buttons. When I click on the buttons, nothing happens, and the corresponding methods ...
RighteousRocks's user avatar
-1 votes
1 answer
80 views

How do I extend JButton but modify actionPerformed?

I'm trying to paint a Windows 11 button on my JFrame. That worked well, but I can't properly add actionlisteners to it. Here is my code: public class MyButton extends JButton implements MouseListener, ...
user avatar
-1 votes
1 answer
57 views

Java Swing JButton disable not giving disired results

This is my first time working with Java Swing, so apologies for missing a lot context. This is using Netbeans 7.0.x--business rational. Code is generated using the "Design" feature in ...
kroger9's user avatar
  • 39
0 votes
1 answer
54 views

How do I execute a function in an ActionListener through the button which is clicked

This is the class I'm using import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class SudokuFeld extends JFrame{ private ...
Paval1s's user avatar
  • 39
0 votes
0 answers
37 views

My output JFrame (2nd) is not showing its components even though my input JFrame (1st) did. Any thoughts?

I was trying to create a simple JFrame input and output GUI with an ActionListener which will listen for 3 buttons (Submit, Clear All, and Okay) and I separated their function and contained them in ...
bigboi's user avatar
  • 1
0 votes
1 answer
80 views

How to make a queue with ActionListener

Have a problem making battleship game. I created 2 panels with game decks for player and opponent. enter image description here When i click on opponents tile and miss i want programm to choose random ...
Lewakosmos's user avatar
1 vote
1 answer
41 views

Java Jtable Not Updating External Values

Im coding this math progam where the user buys and sells stocks and the table calculates the valuation based on price and amount of stocks the user has. (valuation = price*amt) I used a dropdown box ...
helpmepls's user avatar
-2 votes
1 answer
51 views

Why are my JButtons not responding when clicked? [closed]

I'm trying to use the actionPerformed method to print a message to the corresponding buttons (in this case b1/b2/b3). I have no idea where exactly in the code the issue lies. import java.awt.event....
Bobel Studios's user avatar

15 30 50 per page
1
2 3 4 5
147