Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

jframe actionlistener

import javax.swing.*;
import java.awt.event.*;

public class JButtonExample
{
  public static void main(String[] args) 
  {
    JFrame frame = new JFrame("ActionListener Example");
    JButton btn = new JButton("Click here");
    btn.setBounds(70,80,100,30);
    //Change button text on click
    btn.addActionListener(new ActionListener() {
       public void actionPerformed(ActionEvent ae) {
                      btn.setText("OK");
       }
    });
    frame.add(btn);
    frame.setSize(250,250);
    frame.setLayout(null);
    frame.setVisible(true);  
  }
}
Comment

PREVIOUS NEXT
Code Example
Java :: how to convert a collection to array in java 
Java :: circular textview android 
Java :: min priority queue in java 
Java :: java arraylist to array 
Java :: how to compare current date and time with another date and time in android 
Java :: dijkstra java 
Java :: getting the last value of an integer in java 
Java :: enum to int java 
Java :: how to add animation between activity in android 
Java :: initialize arraylist 
Java :: math.sin java 
Java :: android checkbox tint color 
Java :: How to close jframe on click of button 
Java :: list of lists java 
Java :: java stream get list of one field 
Java :: spring boot docker 
Java :: char to int 
Java :: flow dependency android 
Java :: replace substring at index java 
Java :: java how to get all threads 
Java :: overloading + operator in java 
Java :: java join two list 
Java :: print values of bst java 
Java :: java float 0/0 
Java :: timestamp java jpa 
Java :: how to make java list 
Java :: how to get child from layout in android 
Java :: playerhead command minecraft 
Java :: fill two dimensional array rows by rows java 
Java :: how to find the length of a string in java without using length function 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =