Outils pour utilisateurs

Outils du site


informatique:java:tips

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
informatique:java:tips [16/06/2011 09:04] – [Swing] cyrilleinformatique:java:tips [16/06/2023 10:02] (Version actuelle) – [Swing] cyrille
Ligne 4: Ligne 4:
  
 http://filthyrichclients.org/ Le bouquin de Romain Guy & Chet Haase. In Filthy Rich Clients, we explain how to create filthy rich effects in your applications, from the fundamental graphics, GUI, and animation technology up through sample code and algorithms for the effects themselves. Des exemples de code. http://filthyrichclients.org/ Le bouquin de Romain Guy & Chet Haase. In Filthy Rich Clients, we explain how to create filthy rich effects in your applications, from the fundamental graphics, GUI, and animation technology up through sample code and algorithms for the effects themselves. Des exemples de code.
 +
 +[[http://zetcode.com/tutorials/javagamestutorial/|Java 2D games tutorial]]
 ===== Swing ===== ===== Swing =====
  
   * [[http://download.oracle.com/javase/tutorial/uiswing/components/table.html|How to Use Swing JTables]] (binding, cell editors, ...)   * [[http://download.oracle.com/javase/tutorial/uiswing/components/table.html|How to Use Swing JTables]] (binding, cell editors, ...)
   * About [[/informatique/java/tips/Drag & Drop|Drag & Drop]]   * About [[/informatique/java/tips/Drag & Drop|Drag & Drop]]
-  * Plein d'effets visuels avec Swing par Romain Guy: [[http://jroller.com/gfx/page/Archives]]+  * Plein d'effets visuels avec Swing par Romain Guy: <del>[[http://jroller.com/gfx/page/Archives]]</del>
 ===== CVS Format ===== ===== CVS Format =====
  
   * [[http://opencsv.sourceforge.net/]]: opencsv is a very simple csv (comma-separated values) parser library for Java. It was developed because all of current csv parsers I've come across don't have commercial-friendly licenses.   * [[http://opencsv.sourceforge.net/]]: opencsv is a very simple csv (comma-separated values) parser library for Java. It was developed because all of current csv parsers I've come across don't have commercial-friendly licenses.
 +
 +===== Read input from console =====
 +
 +Read console input using **java.io.Console** instance - //Don't work in Eclipse IDE//.
 +<code java>
 +private static void usingConsoleReader()
 +{
 +  Console  console = System.console();
 +  if (console != null)
 +  {
 +     String inputString = console.readLine("Name: ");
 +     System.out.println("Name entered : " + inputString);
 +  }
 +}
 +</code>
 +
 +Read console input using **BufferedReader** instance
 +<code java>
 +private static void usingBufferedReader()
 +{
 +  BufferedReader bufferRead = new BufferedReader( new InputStreamReader( System.in ) );
 +  String inputString = bufferRead.readLine();
 +  System.out.println( inputString );
 +}
 +</code>
 +
 +Read console input using **Scanner** instance
 +<code java>
 +private static void usingScanner()
 +{
 +  Scanner scanIn = new Scanner( System.in );
 +  String inputString = scanIn.nextLine();
 +  scanIn.close();           
 +  System.out.println(inputString);
 +}
 +</code>
 +
 +===== Process Input Stream Reader =====
 +
 +<code java>
 +import java.io.BufferedReader;
 +import java.io.IOException;
 +import java.io.InputStream;
 +import java.io.InputStreamReader;
 +import java.net.InetAddress;
 +import java.net.UnknownHostException;
 +import java.io.*;
 + 
 +public class Traceroute {
 + public static void main(String[] args){
 +  Runtime t = Runtime.getRuntime();
 +  try {
 +   Process p = t.exec("traceroute  "+args[0]);
 +   //Process p = t.exec("ping -w 1 "+args[0]);
 +   InputStream i = p.getInputStream();
 +   InputStreamReader r = new InputStreamReader(i);
 +   BufferedReader re = new BufferedReader(r);
 +   int m =0;
 +   while(true){
 +    String content = re.readLine();
 +    System.out.println(content);
 +    if(content == null){
 +     break;
 +    }
 +   }
 +   re.close();
 +   r.close();
 +  } catch (IOException e) {
 +    e.printStackTrace();
 +  }
 + }
 +}
 +
 +</code>
  
 ===== Convert a Java OutputStream to an InputStream ===== ===== Convert a Java OutputStream to an InputStream =====
Ligne 60: Ligne 136:
   class2.processDataFromInputStream(cbb.getInputStream());   class2.processDataFromInputStream(cbb.getInputStream());
 </code> </code>
 +
 +===== Serial communication =====
 +
 +Communication série avec Java
 +
 +  * http://www.java-samples.com/showtutorial.php?tutorialid=11
 +  * http://christophej.developpez.com/tutoriel/java/javacomm/
 +
 +
  
informatique/java/tips.1308207895.txt.gz · Dernière modification : 19/05/2012 00:15 (modification externe)

Sauf mention contraire, le contenu de ce wiki est placé sous les termes de la licence suivante : CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki