1 2 3 4 5 6 7 8 9
| public void actionPerformed(ActionEvent arg0) {
Object source = arg0.getSource();
if (source.equals(buttonBold)) (new StyledEditorKit.BoldAction()).actionPerformed(arg0);
else if (source.equals(buttonItalic)) (new StyledEditorKit.ItalicAction()).actionPerformed(arg0);
else if (source.equals(buttonLeft)) (new StyledEditorKit.AlignmentAction("left", StyleConstants.ALIGN_LEFT)).actionPerformed(arg0);
else if (source.equals(buttonCenter)) (new StyledEditorKit.AlignmentAction("center", StyleConstants.ALIGN_CENTER)).actionPerformed(arg0);
else if (source.equals(buttonRight)) (new StyledEditorKit.AlignmentAction("right", StyleConstants.ALIGN_RIGHT)).actionPerformed(arg0);
else if (source.equals(buttonUrl)) (new StyledEditorKit.UnderlineAction()).actionPerformed(arg0);
} |
Partager