Click here to Skip to main content
16,006,373 members
Home / Discussions / Java
   

Java

 
AnswerRe: Which is the best editor to use with Java??? Pin
uspatel22-Sep-11 2:03
professionaluspatel22-Sep-11 2:03 
QuestionJAVA : need to learn it ASAP Pin
robin7004-Sep-11 21:25
robin7004-Sep-11 21:25 
AnswerRe: JAVA : need to learn it ASAP Pin
Nagy Vilmos4-Sep-11 22:50
professionalNagy Vilmos4-Sep-11 22:50 
GeneralRe: JAVA : need to learn it ASAP Pin
robin7005-Sep-11 15:58
robin7005-Sep-11 15:58 
GeneralRe: JAVA : need to learn it ASAP Pin
Nagy Vilmos5-Sep-11 21:51
professionalNagy Vilmos5-Sep-11 21:51 
QuestionLOVE Pin
NADEEM CHHIMPA3-Sep-11 21:17
NADEEM CHHIMPA3-Sep-11 21:17 
QuestionRepaint JPanel problem in java Pin
flashery2-Sep-11 5:26
flashery2-Sep-11 5:26 
AnswerRe: Repaint JPanel problem in java Pin
twseitex2-Sep-11 10:58
twseitex2-Sep-11 10:58 
Hi,


JFrame is the container of JPanels (Jframe.add(child);)

JPanel1 with own event listener
JPanel2 with own event listener

You must call JPanel1.repaint() in event listener of JPanel 2
You must call JPanel2.repaint() in event listener of JPanel 1

-----------------------------------------------------


referenz_of_button.addActionListener // no action commands, but all action vvents
(
new ActionListener()
{public void actionPerformed(ActionEvent e) // e is placeholder form actionevent type (see Class ActionEvent)
{
// do something ony for object with referenz_of_button
}
}
);


JButton supports ActionListener
JLabel supports ActionListener

JButton and JLabel support MouseListener , KeyListener etc.

----------------------------------------------------

only if you want to use labels (action commands) of buttons


public void actionPerformed(ActionEvent event)
{
String cmd = event.getActionCommand(); // get label of button, label is the action command
if (cmd.equals("label_of_button1"))
{
// do something für button1
}
if (cmd.equals("label_of_button2"))
{
// do something für button1
}
}

referenz_of_button1.addActionListener(this);
// label of button must be "label_of_button1"

referenz_of_button2.addActionListener(this);
// label of button must be "label_of_button2"

JButton supports ActionListener
JLabel supports ActionListener
QuestionRe: Repaint JPanel problem in java Pin
flashery2-Sep-11 19:21
flashery2-Sep-11 19:21 
GeneralRe: Repaint JPanel problem in java Pin
flashery3-Sep-11 6:55
flashery3-Sep-11 6:55 
GeneralRe: Repaint JPanel problem in java Pin
twseitex4-Sep-11 9:36
twseitex4-Sep-11 9:36 
QuestionWhat is tracking multiple instances? Pin
flashery1-Sep-11 19:41
flashery1-Sep-11 19:41 
AnswerRe: What is tracking multiple instances? Pin
David Skelly1-Sep-11 22:09
David Skelly1-Sep-11 22:09 
AnswerRe: What is tracking multiple instances? Pin
twseitex2-Sep-11 11:04
twseitex2-Sep-11 11:04 
Questionusing a private variable for the lock of synchronized block Pin
quartaela31-Aug-11 3:53
quartaela31-Aug-11 3:53 
AnswerRe: using a private variable for the lock of synchronized block Pin
Nagy Vilmos31-Aug-11 4:07
professionalNagy Vilmos31-Aug-11 4:07 
AnswerRe: using a private variable for the lock of synchronized block Pin
gospidey2-Sep-11 23:58
gospidey2-Sep-11 23:58 
QuestionjTable Pin
Shaahinm30-Aug-11 1:40
Shaahinm30-Aug-11 1:40 
QuestionHow to know user still connect to my website in local network ? Pin
tannghia28-Aug-11 17:28
tannghia28-Aug-11 17:28 
AnswerRe: How to know user still connect to my website in local network ? Pin
jschell29-Aug-11 9:10
jschell29-Aug-11 9:10 
Questioni got java.lang.NullPointerException error while delteing and adding new data inms access DB-pls guide me to solve Pin
jpljayapal27-Aug-11 8:42
jpljayapal27-Aug-11 8:42 
AnswerRe: i got java.lang.NullPointerException error while delteing and adding new data inms access DB-pls guide me to solve Pin
jschell28-Aug-11 8:08
jschell28-Aug-11 8:08 
QuestionComputer talks to u Pin
Had12327-Aug-11 5:48
Had12327-Aug-11 5:48 
AnswerRe: Computer talks to u Pin
Smithers-Jones27-Aug-11 23:48
Smithers-Jones27-Aug-11 23:48 
QuestionGetting the lowest values in one array, and then counting them. Pin
Tor Danielsen25-Aug-11 7:27
Tor Danielsen25-Aug-11 7:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.