Created
July 5, 2017 15:16
-
-
Save nitishk72/ffbdf1b606301557d812228744facecc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Dimension; | |
import java.awt.FlowLayout; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import javax.swing.BorderFactory; | |
import javax.swing.*; | |
/** | |
* @author nitish | |
*/ | |
public class Test extends JFrame implements ActionListener{ | |
JTexdyanmicTF dyanmicTF; | |
JPanel panel; | |
Test(){ | |
JButton add = new JButton("ADD TexdyanmicTF"); | |
add.addActionListener(this); | |
panel = new JPanel(); | |
FlowLayout F= new FlowLayout(); | |
F.setAlignment(0); | |
panel.setLayout(F); | |
panel.add(add); | |
add(panel); | |
} | |
public static void main(String args[]){ | |
Test object = new Test(); | |
object.setSize(new Dimension(800, 500)); | |
object.setLocationRelativeTo(null); | |
object.setVisible(true); | |
} | |
@Override | |
public void actionPerformed(ActionEvent e) { | |
dyanmicTF = new JTexdyanmicTF("Dynamic TF "); | |
dyanmicTF.setPreferredSize(new Dimension(120, 35)); | |
dyanmicTF.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); | |
panel.add(dyanmicTF); | |
revalidate(); | |
repaint(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment