Professional Documents
Culture Documents
7 Butonat Dhe Fontet
7 Butonat Dhe Fontet
hyperlink
file chooser
formatted
text field
frame
internal
frame
list
menu
menu item
internal frame
list data
menu
menu key
menu drag mouse
option
pane
password
field
popup
menu
popup menu
progress
bar
radio
button
slider
spinner
tabbed
pane
table
table model
table column
model
cell editor
text area
text field
text pane
hyperlink
toggle
button
tree expansion
tree will expand
tree model
tree selection
tree
viewport
(used by
scrollpane)
7 BUTONAT
import
import
import
import
import
java.awt.*;
java.awt.event.*;
javax.swing.*;
javax.swing.event.*;
javax.swing.border.TitledBorder;
panel2.add(btn4);
panel2.add(btn5);
panel2.add(btn6);
panel2.add(btn7);
panel3.setLayout(new FlowLayout());
panel3.add(lbl1);
panel3.add(txfiel1);
txfiel1.setEditable(false);
setLayout(new BorderLayout());
add(panel1,BorderLayout.NORTH);
add(panel2,BorderLayout.CENTER);
add(panel3,BorderLayout.SOUTH);
btn1.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent
txfiel1.setText("Butoni 1");
}
}
);
btn2.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent
txfiel1.setText("Butoni 2");
}
}
);
btn3.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent
txfiel1.setText("Butoni 3");
}
}
);
btn4.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent
txfiel1.setText("Butoni 4");
}
}
);
btn5.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent
txfiel1.setText("Butoni 5");
}
}
);
btn6.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent
txfiel1.setText("Butoni 6");
}
}
);
evt){
evt){
evt){
evt){
evt){
evt){
btn7.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent evt){
txfiel1.setText("Butoni 7");
}
}
);
}
public static void main(String arg[]){
SevenButtons svbut=new SevenButtons("Shembull Provimi");
svbut.pack();
svbut.setVisible(true);
svbut.setResizable(false);
svbut.setLocationRelativeTo(null);
}
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
}
FONTET
import
import
import
import
import
import
import
import
import
import
import
java.awt.BorderLayout;
java.awt.FlowLayout;
java.awt.Font;
java.awt.TextField;
java.awt.event.ActionEvent;
java.awt.event.ActionListener;
java.awt.event.ItemEvent;
java.awt.event.ItemListener;
javax.swing.JFrame;
javax.swing.JRadioButton;
javax.swing.JTextField;
/**
*
*/
private static final long serialVersionUID = 1L;
public StilShkrimi1(){
super("RadioButton Test");
setLayout(new FlowLayout());
final TextField kutiaText = new TextField("Watch the font style change");
add(kutiaText,BorderLayout.NORTH);
JRadioButton
JRadioButton
JRadioButton
JRadioButton
Font
Font
Font
Font
}
}
);