06-Nov-2015 12:58
  • Name: Madison Hayes
  • Last online: Today
  • Status:"I wanna be fucked"
You'll need to login now to contact me
Join Up Free >>

Updating jtextarea

i'm trying to update my jtextarea, but it won't show the text i put into it! EXIT_ON_CLOSE ); Size( max L, 600 ); Location( 200, 30 ); JPanel payne = new JPanel(); Opaque( true ); JPanel enter Me = new JPanel(); enter Mouse Listener( this ); enter Background( Color.

" ); add( info Text ); } public void add Text( String text ){ info Text.append( text ); println( info Text() ); } public void clear Text(){ info Text( "" ); info Background( Color."); JText Field num = new JText Field(3); JButton sub = new JButton("Make Groups!"); JPanel top = new JPanel(); JLabel bot Title = new JLabel("The Groups are:"); private Array List groups; int n; public GUIFor Groups() { set Size(800,400); set Title("Group Picker!"); Container c = get Content Pane(); Layout( new Box Layout(c, Box Layout.Y_AXIS ) ); top.add(num Of G); top.add(num); top.add(sub); Action Listener(this); c.add(top); c.add(bottom); try { roster = get Roster(); } catch (IOException ioe) { JOption Message Dialog(null,"Error reading in data, exiting"); System.exit(0); } set Visible(true); set Default Close Operation(Window Constants.EXIT_ON_CLOSE); } public void action Performed(Action Event evt) { String user In ; user In = Text() ; n = Integer.parse Int( user In ) ; team = sort In Groups(n); String s = set Print(); // /bottom.add(bot Title); area.append("Groups\n"+set Print()); // PROBLEM HERE, NOT WORKING // print(s); // was for testing bottom.add(area); add(bottom); repaint(); } public void paint Component(Graphics g) { area.append("The groups are: \n"+set Print()); add(bottom); } public Array List(); Scanner fr = new Scanner(new File("csroster.txt")); while (Next()) { String name = fr.next(); roster.add(name); } return roster; } public Array List sort In Groups(int n) { int i = 0, j=0; String next=""; Array List0) { int num = (int)(Math.random()*roster.size()); next += roster.remove(num) + " "; i++; } i=0; groups.add(next); next = ""; } return groups; } public String set Print() { int team Num = 1; String groups=""; for (String t: team) { groups += "Team # "+team Num+++" is: "+t+"\n"; } return groups; } public static void main (String[] args) throws IOException { GUIFor Groups gui = new GUIFor Groups(); } } public GUIFor Groups() { ...

c.add(bottom); bottom.add(area); // missing a JScroll Pane here try { ...

However, instead of updating the text area after each iteration of the loop when set Text is called, it appears to only update the text when all the runs of the task are done. You are using swing basic threads called initial threads. In my exmaple below the actual work starts from the EDT thread as it is from a button click Action Listener.

Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation.

That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright © 1993, 2016, Oracle and/or its affiliates.

import *; import javax.swing.*; import event.*; import *; import *; public class GUIFor Groups extends JFrame implements Action Listener { JLabel num Of G = new JLabel("How many per group?

Profile for updating jtextarea:

updating jtextarea-78

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “updating jtextarea”

  1. Welcome to the Cruel Network – the place to go to if you are in the mood for lots of quality extreme porn such as forced sex and incest and both of them mixed together for one low price. Cruel Network consists of more than 30 regularly updated forced sex and incest porn sites and news ones are being added all the time.