Setting multiple text dynamically on the GUI

HI,
I have this function which computes the position record of 6 requests. ( ie x,y,dx,dy--these are the position records for a request)
I want to display these position records in a textfield, which i have in my GUI, as soon as i press the "positionrecord" button.
I am able to print the position records for all 6 requests on the console(of eclipse), but on the GUI only the position record of the 6th request is getting displayed in the textfield.
I have been advised by mny to use paint() and repaint() functions for this but no one has been able to give me a concrete solution as yet.
I also need to produce a delay of 1 sec between the position record being displayed in the textfield on the GUI, for which I have used a delay function. THE ONLY PROBLEM IS I AM NOT ABLE TO DISPLAY THE POSITION RECORDS FOR ALL THE 6 REQUESTS ON THE GUI DYNAMICALLY.
Please can anyone help me on this.
I have posted part of my code below. I have put the paint function also but i am not at all sure if it is correct.
Thanks in advance.
warm regards---
public void paint() {
Graphics g= null;
PosRecord prec=requestGenerator.getNextRecord();
Graphics2D g2 = (Graphics2D)g;
double x = 15, y = 50, w = 70, h = 70;
SidePanel.PositionRecc.setText(prec.toString());
MainFrame.mapPanel.repaint();
Ellipse2D e = new Ellipse2D.Double(x, y, w, h);
GradientPaint gp = new GradientPaint(75, 75, Color.white,
95, 95, Color.gray, true);
e.setFrame(x 200, y, w, h);
System.out.println("inside paint function");
if(buffer != null)
bgraphics = buffer.getGraphics();
Graphics2D g2d = (Graphics2D) bgraphics;
if (request.getId()==100) {
System.out.println("Anonmized for message of node id " request.getId() );
System.out.println("Grid Cells: "); //request.getId()
for (int i = 0; i < orequests.size(); i++) {
SidePanel.PositionRecc.setText(request.toString());
paint();
SidePanel.PositionRecc.isOpaque();
System.out.println("NEW");
isVisible();
//MainFrame.mapPanel.repaint();
try
Thread.sleep(100);
catch(InterruptedException e)
//e.printStackTrace();
//super.update(g);
SidePanel.PositionRecc.setText(request.toString());
MainFrame.mapPanel.repaint();
// TraceGenerator.SidePanel.PositionRecc.setText(request.toString());
System.out.print("NEW1 " + orequests.get(i));
}

I had posted it on the wrong forumAnd you still posted in the wrong forum. In the future, Swing related questions should be posted in the Swing form.
The problem is you are blocking the EDT. Read the section from the Swing tutorial on Concurrency for an explanation about what this is and how it works.
I also need to produce a delay of 1 sec between the position record being displayed in the textfieldThe solution is to use a Swing Timer. The code will be executed on the EDT so it will work just as you want. The Swing tutorial also has a section on "How to Use Timers".

Similar Messages

  • How to translate the text dynamically in the program?

    Hi All,
    I have a requirement where I need to translate the text dynamically in the program based on the Language Key retrieved.
    Let's say that the Login language is 'EN' and in the logic has retrieved the language 'IT'(based on some conditions). I have to transate the text(which is maintained using the text elements) to ITALIAN(IT) Language and send the same as an email.
    Could you please tell me if any Function Module is available in SAP which translates the text Dynamically in the program. or is there any other way to translate the text dynamically in the program.
    Could you please share your valuable inputs? Thank you in advance.
    Thanks & regards,
    Paddu.

    you could use SET LOCALE LANGUAGE myLanguage - so you can switch to the desired language and all texts will selected from that language.

  • Multiple text fields on the same line

    Hi
    Is it possible to have multiple text boxes on the same form line?  I'm trying to replicate a form I've created usng Acrobat X Pro but can't seem to figure how to do it with FormsCentral?
    Apologise if I'm missing something obvious!

    We now support multiple fields on one line. This post provides a brief overview.
    Give it a try and send us your feedback.
    Sorry it took so long.
    Randy

  • Changing text features (font, point size etc) in multiple text boxes at the same time

    That pretty much says it all: I'm using pages for some simple initial rendering to send my graphic designer and it would save me some time if I could change the font & point-size for all the various text boxes at the same time.
    Cheers,
    Rax

    Thank you both!
    How 'bout changing the actual content uniformly? Am I still stuck changing each box individually? I know that I am pushing it to do things that it wasn't made for, but I can dream, can't I?
    Thanks again,
    Rax

  • How to set multiple mail icons on the home screen for each email account?

    Hello Everybody,
    I have multiple e-mail addresses setup on my iPhone, but only one mail icon on the home screen. Is it possible to have multiple mail icons on the home screen that are tied to each individual email account?
    Any information is highly appreciated.
    Thanks,
    Pandit Pakhurde

    not possible

  • Is there a way to put multiple text objects in the same frame but with different timings?

    Windows 7
    Adobe Premiere Elements 12
    Beginner User
    I am editing a video of my self talking to the camera and would like to impose text on the screen to highlight what I am saying. When I am discussing each point I would like them to appear as text separately.
    Imagine the video of me standing and talking to the camera
    "Today I am going to talk about travelling in the North of Scotland and give advice on how to get by. I will talk about the best value hostels " - the word 'hostels' appears first at the top right of the screen
    "I will describe the best routes to take" - the word 'routes' now appears under the the word 'hostels'
    "And finally, I will describe the best places to eat traditional Scottish cuisine" - the word 'food' now appears under 'routes'.
    Apologies if this seems basic but the documentation is focuses on using one title or the set effects. I suppse I am trying to create a presentaiton style of video.
    Cheers

    SunnyKSood
    The quickest approach that comes to mind is
    a. create 3 separate titles in the Titler (Text Menu/New Text/Default Text)....
    food, goes on Video 4
    routes, goes on Video 3
    hostels, goes on Video 2
    Arrange them so that when viewed they are viewed as
    hostels
    routes
    food
    b. Move hostels (Video 2) to where you want it to start in relation to
    "Today I am going to talk about travelling in the North of Scotland and give advice on how to get by. I will talk about the best value hostels " - the word 'hostels' appears first at the top right of the screen
    Move routes (Video 3) to where you want it to start in relation to
    "I will describe the best routes to take" - the word 'routes' now appears under the the word 'hostels'
    Move food (4) to where you want it to start in relation to
    "And finally, I will describe the best places to eat traditional Scottish cuisine" - the word 'food' now appears under 'routes'.
    c. When all that is done to this stage, it might look like this...
    Now to arrange and drag out track content so that we see
    hostels
    then hostels + routes
    then hostel + routes + food
    when they are supposed to appear in conjunction with the video's dialog.
    The final workspace should look like
    Please give this a try. And, do not hesitate to let me know if you need clarification on anything described.
    We will be watching for your results.
    Thank you.
    ATR

  • LG Cosmos Touch receives messages in multiple texts with only the last 1 received on the phone

    I like my LG Cosmos phone, but the problem reported in this thread is very annoying and it seems to be getting worse or more frequent. It looks like nothing more has happened since someone posted in 10/2012. Is anyone working on a fix, or does one exist by this time? I have called Verizon approx. 3 times and stopped in the store twice to try to get this resolved. I've been shopping for a phone, but I'm frustrated that I feel like I need to spend money just because of this one glitch in the phone. If I had to guess, I would say that it happens to me most frequently when I receive long texts from people with smartphones, but I can't say for sure. They do not contain pics, sounds files or special characters to my knowledge, but it's hard to say because I only get 2/2. Please help me so I don't have to spend unnecessary money just to get a phone I don't like as much. It's harder and harder to find non-data phones.
    >>Branched from an earlier discussion<<
    Message was edited by: Verizon Moderator

    I am having the same problem here.  I thought it was just with smart phones, but it turns out that even a long message sent from my husband's phone, a regular LG Cosmos, will only show me the last page.  I've done the battery thing, the *228 thing, clearing out not only my inbox, but also my sent box, and I have 4 bars in most places I frequent.  Phones are all set to the same language.  Everyone I communicate with is a Verizon customer as well, except my sister.  She watches the characters of her texts and breaks them up herself into 140 characters or less.  It's very frustrating to have to keep asking people to break up their texts, or resend previous texts.  As I sit here, I have no idea whether or not my other sister is coming for Thanksgiving!!!

  • HT4798 How can I create/ set multiple Mac IDs if the same Macbook is required to be used by Multiple users?

    Can Anyone let me know if have to alllow multiple users with their own apple ids for the same macbook pro, how do I need to go about it?

    data.
    At least your query seems to get data where MODIFIED_BY IS NULL, doesn't it?
    So if the reccount is>0 there is a reason to inform your employees.
    Bye, Olaf.
    Olaf Doschke - TMN Systemberatung GmbH
    http://www.tmn-systemberatung.de

  • One pair of radio buttons to control multiple text objects - Designer 8.0

    Greetings - a big thank you in advance for any assistance. I have often found answers to my problems on this forum, but have been unable to find an answer to the following.
    The short of it - is it possible to make a pair of radio buttons control the visibility of multiple text objects with the same name(I have had success in manipulating only a single text object with one pair of buttons)?
    The long of it - I am trying to make a form bilingual based on the value of a radio button group to control the visibility of the text object in the selected language. When the user selects the language they wish to see, all the text objects in the form switch to that language. I am working with a dynamic PDF.
    I have succeeded to a very limited extent in manipulating one text object by overlaying text objects in both languages, setting one object to "invisible" as default, and controlling that text objects visibility with the following JavaScript in the click event of the radio button group:
    ----- form1.#subform[0].ENG_JPN::click: - (JavaScript, client) -------------------------------------
    if (ENG_JPN.rawValue == 1)///1 equals the value of on
    {English.presence = "visible";}
    else
    {English.presence = "invisible";}
    if (ENG_JPN.rawValue == 2)///2 equals the value of on
    {Japanese.presence = "visible";}
    else
    {Japanese.presence = "invisible";}
    endif
    The problem is I need to manipulate the visibility of all text objects with the same name on the form with a single radio button group. I have tried writing the code as one does for the sum of a repeating field, ie. English[*].presence etc. however I get a C++ error in preview.
    Any ideas are greatly appreciated. I am truly stumped - thank you for your time.

    To access objects with the same name you need to deal with occurance numbers. If your object is called TextField then the 1st occurance will be TextField[0], the second occurance will be TextField[1] etc.....
    The issue is that the [] in javascript are interpretted as an array element so you have to use the syntax: xfa.reolveNode("string") to get to your object names. In your case you would use:
    xfa.resolveNode("TextField[1]").presence = "visible"
    This string syntax allows you to use a var to hold the index number and is very useful with for loops where you want to set large numbers of objects. So if the index was held in the var i then your syntax would be:
    xfa.resolveNode("TextField[" + i + "]").presence = "visible"
    If the objects are in a repeating subform then the occurance numbers are on the subform and not the object. You can always get the expression to use by app.alert(objectname.somExpression). This will return the expression that you need to create.
    Make sense?

  • Can I format a paragraph in illustrator, with multiple text sizes?

    Hi,
    I have a number of paragraphs in illustrator that have the following...
    a title = Arial bold 18 pt.
    body text =Arial reg 14 pt.
    and indents with bullets
    It seems that illustrator only supports one font, size, color, etc. for each Paragraph style. I would like to be able to set the title to Arial bold, 18pt, Blue, and the body text to Arial regular, 14pt, white, with different leadings, within the same style setting. Does anyone know if this can be done?
    Thank you in advance.
    Knewt

    What are you guys talking about? Since when does InDesign support multiple text attributes for a single Paragraph Style? At least in CS3 InDesign's Paragraph Styles have settings for nested Character Styles and drop caps, but you still define one set of text attributes for the Paragraph Style itself.
    In principle it's basically the same in Illustrator. If you want to actually have multiple text treatments in one paragraph, you apply Character Styles to text ranges within the paragraph. Illustrator's implementation of it is pure crap in that inheritance and style redefinition does not work correctly, but the fact remains you certainly can have multiple text treatments in one paragraph, but it is not done with a single Paragraph Style. If using Styles (as you should) it is a matter of nesting Character Styles within paragraphs that have Paragraph Styles applied.
    But I strongly suspect that what Mr. Harley is describing is not really a single paragraph at all. He wants different text sizes, different indents, and bullets. That clearly involves multiple paragraphs.
    Harley, in part of your description of what you want, you seem to be referring to a single textframe object as a "paragraph." A paragraph is a range of text separated by a carriage return. When you define and apply a Paragraph Style, the carriage return defines the range of the Style. When you define and apply a Character Style, the selected range of characters define the range of the Style. You can use multiple Character Styles within a paragraph that has a Paragraph Style applied.
    But you are talking about the need to define several Paragraph Styles to use in one block of text, or "story" (one or several textframe objects). You just need to define three Paragraph Styles:
    Heading: Arial Bold 18 pt.
    Body: Arial Regular 14 pt.
    BodyBullet: Same as Body, but with different indents. Set a tab at the bullet location and at the left indent. (You type your bullet characters; you don't just select "bullets" from a setting.)
    Type all your text, using carriage returns as you would expect. Each carriage return marks the beginning of a new paragraph. (This is as true in Illustrator as it is in InDesign, Word, or anything else.) Click inside a paragraph and apply the appropriate Paragraph Style.
    Now suppose you want to use a convention within your document that emphasizes certain words or phrases by painting them magenta instead of whatever color is defined in the Paragraph Style. Create a Character Style. Name it Emphasis. In that Style, set the character color to magenta. Now swipe across a word in one of your paragraphs and apply the Emphasis Character Style. The whole paragraph still has the Paragraph Style you applied to it. But now the color of a few characters is overridden by the Character Style you have applied to those characters.
    Again, like many things in Illustrator, its implementation of Paragraph Styles and Character Styles is very sloppy compared to other programs. But it is not true that 'InDesign can apply multiple text treatments in a single Paragraph Style, and Illustrator can't.' At least not up to CS3.
    JET

  • Change column header text dynamically

    Hi,
    I have requirement to change the column header text dynamically in sap gui programming. but couldn't see straight forward way to achieve this.
    i tried following link but no success:
    [Re: Dynamic header text in table control - Dialog programming;
    Please share your suggestions if it can be acheived.
    Thanks,
    Rahul
    Edited by: Rahul Yadav on Oct 25, 2010 7:29 PM

    >
    anmol112 wrote:
    > Hi,
    >   So you can try 1 thing,
    > * Dont use default Column Headings
    > * Create I/O and choose ouput only and fix them in place of Column headings.
    > * pass the values to these I/O accordingly.
    >
    >
    > Thanks,
    > Anmol.
    How is this different from the previous post?
    Rob

  • Text created in Premiere showing other text files in the timeline and exports.

    Hi,
    I'm creating slates with text generated in Premiere. For each new slate I am duplicating a text layer, Option + Dragging the duplicate file over the text I'd like to replace, then opening the new text layer in the text editor and updating the information.
    Things seem fine at first and then randomly text layers in the timeline will show text from other files in the timeline. If I open the text file up in the text editor I see the correct info but not in the timeline.
    The only fix I have found is to delete render files, move the text layer around in the timeline, quit and re-open. But still, sometimes when I export, the export preview window will show the wrong text and when I export the file I create shows the wrong text as well.
    It seems like Premiere is getting confused by multiple text files in the timeline and is pointing to the wrong cache files.
    Thoughts would be a huge help!

    Thanks for the tip Kevin. Anything I can do to avoid this in the future?
    I've had this happen on a number of projects. My media and project files are on a SAN, cache and previews are local.
    Thanks,
    Mike Brown
    P: (401) 743-7452

  • Reg Query For Multiple Text Fields

    Hi all
    I am New to this forum..
    I am developing an application for generating reports.
    In my application i have multiple text fields.
    The user might enter any of the textfields or even enter all the fields.
    In those cases how to use the query when some fields are empty??

    Welcome to the forum.
    It always helps to post a small, simplified example of what it is you're trying to achieve.
    (When posting examples, put the {noformat}{noformat} tag before and after the example, so it will get posted formatted on this forum.)
    In those cases how to use the query when some fields are empty??If your textfields serve as parameters/bind variables for you query, then you could use NVL.
    Something like:select ...
    from some_table
    where col1 = nvl(p_col1, col1)
    and col2 = nvl(p_col2, col2)
    And how about wildcards (the '%' or '_' sign), by the way? Are they allowed as well?
    You also might want to read about this approach:
    http://www.oracle.com/technology/oramag/oracle/09-jul/o49asktom.html                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to make copied text appear in the correct order?

    I have a PDF document with text created from a Photoshop file.
    There were multiple text layers in this Photoshop document.
    Problem:
    When I do "select all text" in Acrobat and then "copy" and then paste it into a text editor the text is pasted out of order.
    This is somewhat expectable because of the multiple text layers in the original Photoshop file.
    Question:
    How can I tell Photoshop the desired order of the text layers when creating the PDF file?
    The layers are stacked in the correct order in the layer panel in Photoshop. I was hoping that was the issue, but it's not. Is there any other way in which I can specify the text order?
    Your help will be much appreciated!

    This is a screen capture taken of Acrobat XI Pro. In the left-hand side try right-clicking (or Ctrl-click on the Mac) ont he navigation pane and then choosing Content.

  • Set a Text Item

    Hi,
    I have a text item. I also have an application item.
    I want to set this text item with the value of the application item every time the page is redirected.
    Is thos possible????
    How do I do this?
    Plase suggest.
    Thanks.
    Edited by: machan on Feb 9, 2010 1:03 PM

    Machan,
    You should be able to set the Text item with the value of the Application item if Source Type = "Item (Application or Page Item Name)".
    Ittichai

Maybe you are looking for

  • How many Apps can i have on my iPod Touch, is there a limit?

    Is there a limit on how many Apps i can have on my iPod Touch? Thanks in advance.

  • RFC CONNECTION BETWEEN DS AND BW

    Hi Experts, I'm facing an issue Loading a BW Cube from Data Services because the RFC connection is lost frequently and to restore it we have to reboot the Data Services server in order to execute the loading job. We've already installed the fix pack

  • IPhone 4S cameras do not work after iOS 8 upgrade

    I have an iPhone 4S 16 GB, It worked perfectly under iOS 7.1.2. . . I upgraded the OS to iOS 8.0.2 about two weeks ago. ( Bad Move ) I noticed right off that my device was running a little slower, lagging, and worst of all my "Camera"  App does not h

  • Devilspie no longer working? [solved]

    Did configuration change again? Because my xmms script is no longer working for devilspie(then again no scipts are working). Heres my xmms script: 1 (if (is (application_name) "XMMS") 2 (begin 3 (skip_pager) 4 (skip_tasklist) 5 (below) 6 (pin) 7 ) 8

  • G510 Windows 8.1 Pro X64 Conexant Audio Driver Error and Driver Update Request

    When are we to expect some updates in the drivers for G510, specifically for both graphics (Intel and AMD) Also I am using G510S's Lenovo Power Management for Windows 8.1(running with no issues) as Windows 8 version was not compatible and there is no