editer un label java
public class inter extends JFrame implements ActionListener{
JTextField j;
JButton b;
JLabel l;
public inter(){
l=new JLabel("the worst area");
b=new JButton("changer");
b.addActionListener(this);
j=new JTextField(20);
j.setVisible(true);
this.setLayout(new FlowLayout());
this.add(l);
this.add(j);
this.add(b);
l=new JLabel("the worst area");
this.setTitle("diagnostic");
this.setSize(300, 300);
this.setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
if (e.getSource()==b){
this.l.setText(j.getText());
}
}
}
Also in Java:
- how to multiply a number by itself using for loop in java
- java how to define a function
- close searchview android java
- Error executing Maven. java.io.FileNotFoundException: The specified user settings file does not exist: /etc/java-8-openjdk
- java script to detect the crome browser
- how to find the divisors of a number in java
- 2d array length in java
- how to get witdth of window android
- how to compare string in java
- java replaceall single character
- what is java
- how to create a list in java
- java map string to list
- diagonal difference hackerrank solution in java 8 using list
- make recycler view non scrollable
- how to print array in java using for loop
- eclipse does not support logback with spring boot
- convert integer array to string array
- how to select a element in an arraylist java
- java comments
- how to stop a void java
- math max java
- déclarer un tableau en java
- delete element from arraylist