mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 23:31:05 +07:00
19 lines
422 B
Java
19 lines
422 B
Java
import javax.swing.JPanel;
|
|
import javax.swing.JButton;
|
|
|
|
public class EDTSwingComponent {
|
|
public void testMethod() {
|
|
JPanel panel = new JPanel();
|
|
panel.setVisible(true); // Requires EDT
|
|
panel.repaint(); // Safe method - no requirement
|
|
|
|
setupButton();
|
|
}
|
|
|
|
private void setupButton() {
|
|
JButton button = new JButton("Click");
|
|
button.setText("Updated");
|
|
button.revalidate();
|
|
}
|
|
}
|