Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

settext java

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class thisismytest2 {
    public static void main(String[] args) {

        final JFrame frame = new JFrame();  
        JPanel panel = new JPanel();    
        JTextField nameField = new JTextField("...", 2);    
        JButton button1 = new JButton();
        final JLabel label1 = new JLabel();
        label1.setText("txt");
        label1.setVisible(false);
        String txt = nameField.getText();

        frame.add(panel);
        panel.add(button1);
        panel.add(label1);
        frame.setSize(200,200);
        frame.setVisible(true);
        panel.add(nameField);
        frame.setSize(600,400); 
        nameField.setBounds(400, 40, 400, 30);

        button1.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent arg0) {

                label1.setVisible(true);
            }
        });
        }
        }
Comment

PREVIOUS NEXT
Code Example
Java :: float.compare java 
Java :: How to read and write XML files 
Java :: java structure example 
Java :: declare generic set java 
Java :: regex double quote java 
Java :: java pointer 
Java :: how to create an entry in java 
Java :: java multithreading 
Java :: program to check if the given date is in in the format dd/mm/yyyy java 
Java :: can i run script in ubuntu using java 
Java :: java check if int 
Java :: loop array using stream java 
Java :: if checkbox checked java 
Java :: spring xml configuration 
Java :: how to create hashmap 
Java :: interface extending interface in java 
Java :: BodyContentImpl memory leak 
Java :: jdbc dependency 
Java :: A* shortest path algorithm 
Java :: max int array java 
Java :: ClassNotFoundException: org.springframework.ui.freemarker.FreeMarkerConfigurationFactory 
Java :: java require non null 
Java :: android java change text value 
Java :: java lamda 
Java :: compress a directory in java 
Java :: single linked list in java 
Java :: Java Create a LinkedHashSet 
Java :: if not java 
Java :: how to create dynamic string array in java 
Java :: get width and height of screen libgdx 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =