Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1585 connectés 

  FORUM HardWare.fr
  Programmation
  Java

  [Swing / JTextArea] Aligner une scrollbar sur le bas d'un JTextArea

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[Swing / JTextArea] Aligner une scrollbar sur le bas d'un JTextArea

n°463583
thunderbir​d54
Posté le 21-07-2003 à 16:31:09  profilanswer
 

Bonjour,
 
dans mon code je fais ca :
 

Code :
  1. JTA_Com = new JTextArea();
  2. JScrollPane p=new JScrollPane(JTA_Com);


 
J'ajoute du texte au fur et a mesure dans le JTextArea mais la barre de defilement ne s'aligne pas sur le texte qui s'affiche, j'aimerais savoir ce qu'il faut faire pr que lorsque j'affiche du texte dans JTA la barre de defilement descende en meme temps.
 
je ne sais pas si c'est tres clair, enfin j'espere que vous avez compris.
 
A+
 
 

mood
Publicité
Posté le 21-07-2003 à 16:31:09  profilanswer
 

n°463617
phnatomass
Je m'empare de ton esprit !!
Posté le 21-07-2003 à 16:52:43  profilanswer
 

Il faut ajouter ton ScrollPane uniquement à ton container et non ton TextArea ou les 2


Message édité par phnatomass le 21-07-2003 à 16:54:12
n°463693
thunderbir​d54
Posté le 21-07-2003 à 17:57:39  profilanswer
 

oui je c c'est fait ca! LOL
 

Code :
  1. Centre.add(p);// centre est un JPanel


 
moi je veux que lorsque j'ajoute du texte, la bar de defilement soit tout en bas du JTextArea au lieu de garder sa position initiale.
 

n°464201
veryfree
Posté le 22-07-2003 à 00:15:06  profilanswer
 
n°464486
thunderbir​d54
Posté le 22-07-2003 à 11:36:52  profilanswer
 

mici bcp!  :love:  

n°464490
Taiche
(╯°□°)╯︵ ┻━┻
Posté le 22-07-2003 à 11:37:32  profilanswer
 

Vaut mieux faire du SWT :o
http://www.eclipse.org/swt


---------------
Everyone thinks of changing the world, but no one thinks of changing himself  |  It is the peculiar quality of a fool to perceive the faults of others and to forget his own  |  Early clumsiness is not a verdict, it’s an essential ingredient.
n°464587
veryfree
Posté le 22-07-2003 à 13:09:34  profilanswer
 


 
ca suffis le racollage :o

n°464589
veryfree
Posté le 22-07-2003 à 13:10:08  profilanswer
 

Thunderbird54 a écrit :

mici bcp!  :love:  
 


 
your welcome :sol:

n°464806
Taiche
(╯°□°)╯︵ ┻━┻
Posté le 22-07-2003 à 15:11:18  profilanswer
 

veryfree a écrit :


ca suffis le racollage :o


J'fais surtout la promotion d'une API bien mieux foutue en termes de perfos et d'utilisation que les deux pôv trucs intégrés à Java qu'on ose appeler API d'interface graphique :o


---------------
Everyone thinks of changing the world, but no one thinks of changing himself  |  It is the peculiar quality of a fool to perceive the faults of others and to forget his own  |  Early clumsiness is not a verdict, it’s an essential ingredient.
n°464818
veryfree
Posté le 22-07-2003 à 15:16:44  profilanswer
 

Taiche a écrit :


J'fais surtout la promotion d'une API bien mieux foutue en termes de perfos et d'utilisation que les deux pôv trucs intégrés à Java qu'on ose appeler API d'interface graphique :o


c difficile de migrer une appli entiere en swt?
est ce que des skins sont dispo ?

mood
Publicité
Posté le 22-07-2003 à 15:16:44  profilanswer
 

n°464833
Taiche
(╯°□°)╯︵ ┻━┻
Posté le 22-07-2003 à 15:26:35  profilanswer
 

veryfree a écrit :


c difficile de migrer une appli entiere en swt?
est ce que des skins sont dispo ?


A migrer, je pense que t'en as pour longtemps, ouais. Ca remplace tout Swing/AWT donc faut tout redéfinir. Au niveau de l'architecture de l'appli, je sais pas.
Pour les skins, non, je crois pas. Perso je vois pas bien l'intérêt dans la mesure où la plupart des interfaces des OS sont skinnables (pis de toute façon, j'aime pas les skins).
En lisant la FAQ ( http://dev.eclipse.org/viewcvs/ind [...] e/faq.html ), je tombe sur :

Citation :

Q: How do I make SWT show the Windows XP skins?  
A: In order for an application to show the Windows XP skins, there must be a manifest file located in the same place as the executable that launches the application. Here is a sample manifest file to download.  
The name of the manifest file must match the name of the executable. In the case of eclipse, the executable is javaw.exe and the manifest file must have the name javaw.exe.manifest. The manifest file must be in the jre\bin folder for the VM you use to launch Eclipse. Note: the eclipse.exe executable does not launch Eclipse; eclipse.exe displays a splash screen and then invokes the Java VM.


Pour les autres OS, en revanche...


---------------
Everyone thinks of changing the world, but no one thinks of changing himself  |  It is the peculiar quality of a fool to perceive the faults of others and to forget his own  |  Early clumsiness is not a verdict, it’s an essential ingredient.
n°464880
thunderbir​d54
Posté le 22-07-2003 à 15:52:15  profilanswer
 


 
marche pu le lien :-/

n°464882
Taiche
(╯°□°)╯︵ ┻━┻
Posté le 22-07-2003 à 15:53:43  profilanswer
 

Thunderbird54 a écrit :


marche pu le lien :-/


Ah ba normalement si, hein, j'y accède depuis ici [:ddr555]


---------------
Everyone thinks of changing the world, but no one thinks of changing himself  |  It is the peculiar quality of a fool to perceive the faults of others and to forget his own  |  Early clumsiness is not a verdict, it’s an essential ingredient.
n°464891
thunderbir​d54
Posté le 22-07-2003 à 15:57:59  profilanswer
 

ah ben oué LOL
 
jte jure ke ya 2sec marchait po

n°464924
Taiche
(╯°□°)╯︵ ┻━┻
Posté le 22-07-2003 à 16:10:53  profilanswer
 

Thunderbird54 a écrit :

ah ben oué LOL
 
jte jure ke ya 2sec marchait po


P'têt le serveur est tombé [:spamafote]
Comme c'est un gros truc assez sollicité, je pense pas que les plantages durent longtemps de toute façon :)


---------------
Everyone thinks of changing the world, but no one thinks of changing himself  |  It is the peculiar quality of a fool to perceive the faults of others and to forget his own  |  Early clumsiness is not a verdict, it’s an essential ingredient.
n°465126
thunderbir​d54
Posté le 22-07-2003 à 18:01:34  profilanswer
 

jviens de me tapper une exception :(
c'est a propos du bout de code que j'ai rajouté alors ca m'embete d'autant plus que je ne la comprends pas trop  :??:  
 
le JTextArea avait un enorme log le pb vient ptet de ca ?
 
sun.java2d.InvalidPipeException: bounds changed
 at sun.awt.windows.Win32Renderer.devCopyArea(Native Method)
 at sun.awt.windows.Win32SurfaceData.copyArea(Unknown Source)
 at sun.java2d.SunGraphics2D.copyArea(Unknown Source)
 at javax.swing.JViewport.blitWindowGraphics(Unknown Source)
 at javax.swing.JViewport.blitDoubleBuffered(Unknown Source)
 at javax.swing.JViewport.windowBlitPaint(Unknown Source)
 at javax.swing.JViewport.setViewPosition(Unknown Source)
 at javax.swing.JViewport.scrollRectToVisible(Unknown Source)
 at javax.swing.JComponent.scrollRectToVisible(Unknown Source)
 at PanneauFond.afficher(PanneauFond.java:355)
 at FTP.lecture(FTP.java:242)
 at FTP.setPort(FTP.java:100)
 at FTP.getListe(FTP.java:263)
 at Delockage_dev.parcourirCollection(Delockage_dev.java:55)
 at Delockage_dev.run(Delockage_dev.java:114)


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Java

  [Swing / JTextArea] Aligner une scrollbar sur le bas d'un JTextArea

 

Sujets relatifs
Aligmenent avec/sans la scrollbar de Mozilla[JAVA]Savoir ce qui se passe quand click sur une scrollbar
GUI Swing[HTML/JS] Largeur d'un scrollbar
Swt et Swing[html/css] aligner veticalement dans un DIV
[VB] récupérer un evenement sur la scrollbar d'une listboxtextarea sans apparition de scrollbar
java + swing + graph2Dswing & awt
Plus de sujets relatifs à : [Swing / JTextArea] Aligner une scrollbar sur le bas d'un JTextArea


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR