1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
StringBuffer buf = new StringBuffer();
buf.append(jEditorPane3.getText());
jEditorPane3.setContentType("text/html");
jEditorPane3.setEditable(false);
String bot = jTextArea9.getText().toUpperCase();
String util = "<br>" + " - " + user + " : " + jTextArea9.getText();
String reponse = bot.replaceAll("[^a-zA-Z0-9]", "");
jEditorPane3.addHyperlinkListener(new HyperlinkListener() {
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
try {
Desktop desktop1 = Desktop.getDesktop();
if (desktop1.isSupported(Desktop.Action.BROWSE)) {
URI sss = new URI(e.getURL().toString());
desktop1.browse(sss);
}
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, ex.toString());
}
}
}
});
if(reponse.contains("GNU") && reponse.contains("LINUX") && reponse.contains("QUESCEQUE")) {
jEditorPane3.setText(buf + util + "<br>" + "TuxBot : C'est un système d'exploitation libre, basé sur le noyau Linux et les logiciels libres issu du projet GNU. Le tout forme une distribution Gnu/Linux. " + "<a href=" + " http://fr.wikipedia.org/wiki/Distribution_linux" + ">" + "Lire l'article sur le site" + "</a>" + "<br>" + "<br>");
jTextArea9.setText("");
}
else if(reponse.contains("DISTRIBUTION") && reponse.contains("LINUX") && reponse.contains("QUESCEQUE")) {
jEditorPane3.setText(buf.toString() + util + "<br>" + "TuxBot : C'est un ensemble cohérent de logiciels libres, provenant souvent du projet GNU, autour du noyau Linux." + "<br>" + "Il existe un grand nombre de distributions différentes, avec des objectifs différents comme la simplicité d'utilisation, la gestion réseau, orienté serveur, sécurité, etc." + "Les principales distributions sont Debian, Ubuntu (dérivé de Debian), Fedora, Mageia, OpenSuse." + "http://fr.wikipedia.org/wiki/Distribution_linux" + "<br>");
jTextArea9.setText("");
} |
Partager