One more basic question with Compound message

Hello,
i wanted to know one thing :
Using JOptionPane , or on a JLabel , sometime i need to display some message which value is a variable (i mean whole message is variable) ,
for ex.
JOptionPane.showMessageDialog(null, result, "Error", JOptionPane.OK_CANCEL_OPTION);
or
JLabel label = new JLabel();
label.setText(result);
NOW in both cases "result" is variable ( a String )
HOW to localize it ?
As i understand it wont be possible to localize it.
Please suggest .
thanx for ur time and help,
Rajesh

All you have to do is store all possible error messages in your ResourceBundle files. The following is a section of my ResourceBundle.properties file:
# ParseException messages
err0 =Unexpected end of expression
err1 =Parenthesis or Bracket mismatched
err2 =Too many arguments
err3 =Too few arguments
err4 =Variable or Constant expected after an operator
err5 =Missing right brace
err6 =Unexpected comma
err7 =Invalid range name or address
err8 =Unrecognized function name
err9 =Invalid numeric constant
err10=Unrecognized operator
err11=Unterminated string
err12=Operator expected
err13=Unrecognized array delimiter
err14=Unrecognized array constant
err15=Not a balanced array
err16=Invalid If-Then-Else format
err17=Invalid Expression
err18=Named variable not accompanied by an assignment operator
Now, in a ResourceBundle for a specific Locale, the characters to the right of the equal sign (=) would be translated into the correct characters for the Locale.
The way it works in my program is that given the error number encountered, I would fetch the appropriate error message and store it in something similar to your result and display it (so it effect, result is a variable). For example:
             ResourceBundle F=PropertyResourceBundle.getBundle("myErrMsg",Locale.getDefault());
             if (j<0) {
                 errmsg=F.getLocalizedMessage("err18");
                 throw new ParseException("",errmsg,0);That's how you have to do it......
I guess what I'm trying to say is you can make result a variable to a certain extent but since you need to internationalize it, the only way to do it, as far as I know, is by using the ResourceBundle.
V.V.

Similar Messages

  • Basic questions with respect to ABAP WebDynpro Application

    Hi All,
    I have two basic questions with respect to an ABAP WebDynpro application :
    a) If an ABAP WebDynpro application has been developed, how could it be made available to the end user?
    b) Can an ABAP WebDynpro application be developed in ECC or is it only applicable for version 4.6c?
    Thanks & Regards,
    Sushanth Hulkod

    Sushanth Hulkod wrote:
    > a) If an ABAP WebDynpro application has been developed, how could it be made available to the end user?
    >
    > b) Can an ABAP WebDynpro application be developed in ECC or is it only applicable for version 4.6c?
    a) If an ABAP WebDynpro application has been developed, how could it be made available to the end user?
    Answer - By providing direct link of the WD application created in SE80, creating iView for webdynpro abap application in the portal environment and  NWBC environment
    b) Can an ABAP WebDynpro application be developed in ECC or is it only applicable for version 4.6c?
    Answer - Yes it can be developed in ECC. Webdynpro ABAP is introduced in NW 2004s (SAP NetWeaver 7.0 or ECC 6.0)
    Thanks,
    Chandra

  • I need some more interview question with answer on modeling,reporting.

    i need some more interview question with answer on modeling,reporting.

    Hi,
    You may find tons of topic about interview question. Please try to search forums before opening a post next time.Take a look at the link below.
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=bwinterviewquestions&adv=true&adv_sdn_all_sdn_author_name=
    Regards,
    ®

  • One very basic question about inheritance

    One very basic question about inheritance.
    Why we need inheritance?
    the benefit of inheritance also achieve by creating instance of base class using it in other class instead of extending the base class.
    Can any one please explain why we are using inheritance instead of creating object of base class????

    SumitThokal wrote:
    One very basic question about inheritance.
    Why we need inheritance?
    the benefit of inheritance also achieve by creating instance of base class using it in other class instead of extending the base class.
    Can any one please explain why we are using inheritance instead of creating object of base class????What did you find out when you looked on Google?
    One example of inheritance comes in the form of a vehicle. Each vehicle has similarities however they differ in their own retrospect. A car is not a bus, a bus is not a truck, and a truck is not a motorbike. If you can define the similarities between these vehicles then you have a class in which you can extend into either of the previous mentioned vehicles. Resulting in a reusable class, dramatically reduces the size of code, creates a single point of definition, increases maintainability, you name it.
    In short there are thousands of benefits from using inheritance, listing the benefits could take a while. A quick Google search should give you a few hundred k if not million links to read.
    Mel

  • Connecting to the internet + one more Macbook question

    I've just noticed that I haven't updated my profile, but I am no longer using an eMac. That machine just died on me, so I've purchased my first Macbook. I've also moved into a new apartment, and cannot get connecting using the apartment's existing ethernet connection.
    My girlfriend has a cable modem and uses an ethernet cable to connect her PC. Our compters are on the same table, so we share the ethernet cable. But when I plug it ino my Macbook, no dice. Can't reach the internet. Any clues? I don't know a lot about internet connections, but I have my network settings set for a DHCP connection, and I'm told that it's all set correctly and should work. Maybe my girlfriend's connection only allows for one computer in the apartment?
    One more question: I don't like the color scheme on this new Macbook as much as I did my old eMac. On this one, the whites (for instance, the background of this page) seem "too white." So much so that it hurts my eyes. When I turn the brightness down, it makes the blues and grays look dull. But when I turn the brightness back up, the whites are blinding. Has anyone else noticed this?
    eMac 40GB 1.25 GHz G4   Mac OS X (10.3.9)  

    If your Sky router is anything like my Netgear, the problem is the way you have to enter the WEP password on a Mac. IIRC, there are a couple of options for the password format, and you need to choose the right one. I think they were Hex and ASCII. My password has to be entered as 26 characters of Hex - that's how the passkey is displayed in the router when you enter the password there for the first time.
    On a Windows machine, I just key that password in full. On my Macs, I have to tell it that I'm using Hex, not ASCII - there's a drop down box with all the various options somewhere that allows you to select the encryption type and the key format.
    For some reason, OS X isn't clever enough to work out whether you are entering Hex or ASCII.
    If you get really stuck, you can always disable WEP on the router - log in using a wired connection (usually you type 192.168.0.1 into Safari) and set wireless security to none. Check that your macbook can now connect wirelessly, then re-enable security, making a note of the new passkey.
    Might be worth doing this anyway, and choosing a more secure setting.

  • Sorry. One More OnyX Question!

    Sorry. I just realized I had one more question pertaining to OnyX. When I'm on the Optimization page, it says to either "update" or "complete optimization" options for optimization. What do either of those options mean? I'm just a little scared to try any of those things if I don't know what they do.
    Thanks,
    Rodriguez_Prime
    iBook G4 14'' 30GB HD 1.2 GHz PowerPC 256MB   Mac OS X (10.4.9)   (RED) 2nd Gen 4GB iPod Nano•••Black 1st Gen 2GB iPod Nano

    Rodriguez,
    If you value your data, you will sit down and understand what it means to backup your data. Lack of patience is no excuse. You'd have even more lack of patience with your machine when you lose it all. Keep at least two copies of everything at all times. Don't reformat your hard drive without making sure there are two external copies of your data. Methods of backing up vary by individual. If you are the kind who lacks patience, run a clone every night the weather is known to be good with Superduper. It has the least complicated interface. Use a couple external Firewire hard drives at least the size of the internal hard drive to make the clone. An iPod is not a backup, since software copying music from the iPod to the computer is unreliable.
    Upgrade only when you need to, and are aware that everything you have works with the update before you do upgrade. And repair permissions before and after with Applications -> Utilities -> Disk Utility.
    Upgrade and backup only when you have no peripherals attached other than Apple's own (i.e. keyboard, mouse). A display is not affected by updates or backups, as long as there is no USB or Firewire plugged into the display.

  • One more ultrabeat question....

    hello folks...
    i have an idea which i want to try but have no clue how to get it done in ultrabeat...
    so i load three samples in ultrabeat (with drag & drop) say 1.snare 2.hi-hat and 3.one more hi-hat
    now is it possible to have one hi-hat in 1/8 resolution playing in the pattern and other in 1/16 resolution (at the same time) and is copied to logic when i drag the pattern of it. hope i am clear here with the question....
    i am not able to do this because when i change the RESOLUTION in the lower options it changes resolution of every sample loaded (1-25)
    waiting for an answer....

    In short... No!
    The resolution parameter affects the 'size' of each step for all sequences in a pattern.
    Maybe you could program one of the parts in a second pattern set to the correct resolution, import that MIDI region, the merge the two regions.
    Or maybe run 2 instances of Ultrabeat??
    HTH
    CCT

  • One more generics question

    One more dumbshit generics question...
    Is there a way to do this without the warnings or the @SuppressWarnings({"unchecked"})
       * Returns the index of the last occurrence of the specified element in this
       * list, or -1 if this list does not contain the element.
      //@SuppressWarnings({"unchecked"})
      public int lastIndexOf(Object object) {
        int i = 0;
        int last = -1;
        for(Node<E> node=this.head.next; node!=null; node=node.next) {
          if (node.item.equals((E) object)) {
            last = i;
          i++;
        return(last);
    produces the warning
    C:\Java\home\src\linkedlist\LinkedList.java:313: warning: [unchecked] unchecked cast
    found   : java.lang.Object
    required: E
          if (node.item.equals((E) object)) {
                                   ^... remembering that List specifies +public int lastIndexOf(Object object);+ as taking a raw Object, not E element, as I would have expected.
    Thanx all. Keith.
    PS: Crossposted from the tail of http://forum.java.sun.com/thread.jspa?messageID=10225418&#10225418
    which nobody has answered, I presume because the thread is marked as "answered".

    I'm not sure you understood or if I made myself clear. Or perhaps I'm missing a vital detail in your implementation.
    I'm talking about the cast to E in this line:if (node.item.equals((E) object)) {Object.equals() takes a parameter of type Object. So the cast to E is superfluous. That cast is what's causing the warning. You remove the cast => no more warning => you can remove the SuppressWarnings annotation.
    Unless your E's have an overloaded equals() that takes an argument of type E. In that case you'll have to live with it.

  • Hehe one more speedfan question

    Ok i realise that ive asked this before, but im sure that p2 diode is giving me bogus readings.
    My p4 has the stock hs, with the shitty normal heat pad thingy and right this moment my cpu is at 30-31c (alledgedly) and my mboard at 30c (which i can believe).
    Sorry to sound like a nagging old woman or something but i just cant believe my cpu is at 30c with stock hs.
    Alternative settings give me 45c for cpu which seems right to me.
    One more last thing what is the p2 diode?
    Am i right in thinking p2 diode is built into the cpu and thermistor is part of the mboard?????????????

    I was in the exact same boat as you when I originally fired up my comp...I wasn't too worried about the temp cause 45C with stock cooling sounded right...however, when I changed my hsf to the thermalright SP-94 with a vantec tornado 80mm, installed with artic silver 5, I was still getting 45C.  So I re-installed the hsf to ensure I didn't do something totally crazy, fired up once more, and guess what temp I got with thermistor diode? that's right...45C.  I then switched to PII diode and started getting MUCH more realistic temperatures.  So believe what you like, but I'd stick with the PII diode readings if I were you...at least until a response from MSI is given.    

  • One more memory question

    Hi again everybody,
    I just realized I forgot to ask one more thing about memory. Does anyone know, using System.setProperty, what the command is to set the JVM to a specific size inside the program? I don't mean setting the memory size permanently, I mean setting it just for the run of the program. I'm trying to get my application not to depend on the command line so I can take it out of my IDE.
    Thanks,
    Jezzica85
    Edited by: jezzica85 on Apr 10, 2008 8:31 PM

    Yeah Kajbj I agree with you only from external side we can set the heap memory size.
    As you told already it is impossible to set the heap memory size dynamically with in the program.
    Suppose Task A has B,C,D tasks and we want to set different set different size of heap memory to these tasks
    in this case lets have B,C and D as separate processes and invoke them from A with the heap memory sizes we wanted.
    Its just an idea feel free it criticize it.
    *If our tasks are as simple as the ones i have told this will be good otherwise it becomes complete mess.
    Thanks
    D. L. Kumar

  • [solved] One more conky question (convert cpu temp from C to F)

    Okay, one more and then conky is finished I want to convert my cpu temp from C to F because it's just easier to understand for me, I am an american ... I've tried various ways I've found on these forums, but none of them seem to work, here's my cpu temp conky script:
    ${execi 1200 echo $(($(cat /sys/bus/pci/drivers/k10temp/0000:00:18.3/temp1_input) / 1000)) C}
    Last edited by Mr_ED-horsey (2011-07-21 01:26:16)

    What's the output of
    cat /sys/bus/pci/drivers/k10temp/0000:00:18.3/temp1_input
    ? It should read about 55 C.
    I have no idea how the sensors work, I've never used them, but you can doublecheck the conversion using just about anything, even google: http://www.google.pl/search?q=55+c+in+f … =firefox-a

  • One more scrollbar question...

    I have a JTable 'embedded' in a JScrollPane. The table is wide enuf and hence the horizontal scrollbar
    is always present. The problem is, whenever I click on the table the horizontal scrollbar moves accordingly.
    I dont want this to happen. I should be able to move horizontally ONLY using the respective scroll bar.
    Any one knows how to do it ?
    Thanks.

    Hi Codekin,
    To address your first question, the best way to create a tooltip type of message would be to register the PlotMouseMove event. This event will fire everytime you move the mouse cursor over a plot. You can then create a callback function which you can use the X and Y coordinates, which the event provides, and display them any way you desire.
    Unfortunately, you can not add a Horizontal Scroll Bar to the graph control. On the graph tab of the properties, there is Track Mode selection which allows you to decide what to do with the graph as the data leaves the original screen. Although none of these allow for a scroll bar, you should be able to find the best behavior by playing around with these values.
    This should get you on your way, but if you have any additional questions whatsoever, please repost and I'll get back to you as soon as I can. Thanks and have a good one.
    Adam B.
    Applications Engineer
    National Instruments

  • One more fb question......

    If I deleted my messages from my blackberry with someone on facebook does it delete the message from their
    messages as well?  I know this sounds like a stupid question but I just don't know the answer and need to....

    I'm not sure you understood or if I made myself clear. Or perhaps I'm missing a vital detail in your implementation.
    I'm talking about the cast to E in this line:if (node.item.equals((E) object)) {Object.equals() takes a parameter of type Object. So the cast to E is superfluous. That cast is what's causing the warning. You remove the cast => no more warning => you can remove the SuppressWarnings annotation.
    Unless your E's have an overloaded equals() that takes an argument of type E. In that case you'll have to live with it.

  • One more time - problems with fans

    I realize this is but one of hundreds or possibly thousands of cases of Mac users being plagued by fan noise problems, but to me it has been a long and extremely frustrating saga. I have been a Mac user since the very beginning, through different versions of Macs and iMacs, and this is the first time I ever refer to a Macintosh as a "piece of junk."
    I bought my iMac G5 in August 2005, a 20-inch ALS with 250 GB hard drive and 512 MB RAM. It worked perfectly until January this year, when all of sudden it shut down by itself. Freaked me out completely. Turned out to be power supply problem (EMC 2056) which Apple never informed me about.
    I brought it to a repair shop that fixed the intermittent shut-down problem. I also added 1GB memory. But then the fans started to go berserk. Before the power supply problem, I only heard the fans whenever I used a large program like Photoshop. For the most part, it was a very quiet machine. After the power supply was replaced, within minutes of turning the iMac on, I could hear the fans spinning faster and faster, stabilizing at around 4400 rpm and did not stop spinning until I put the iMac to sleep or turned it off, regardless of CPU usage or software being used.
    I checked the discussions at this forum (over 500 posts, no real answer) and did every "voodoo trick" suggested: I reset the SMU dozens of time, cleaned the inside of the iMac and around the fan area, did apple hardware test (everything was fine), monitored temperature and activity with XRG (average CPU at 160F, hard drive at 113F), cleaned out caches, tested for corrupt preferences, re-installed the original OS 10.4 (which only made the fans louder), upgraded it back to OS 10.4.9. I also removed the additional 1 GB memory, thinking it might be a bad piece. It didn't help.
    Finally, I requested fan replacement from Apple and got them. I installed them last Sunday and now the problem is even worse! Within SECONDS of turning it on, the CPU T- Dio soars to around 170F, even while the machine is still stone cold to the touch. The hard drive temperature now averages at 117F, CPU fan is never below 4000 rpm (4400 rpm 98% of the time), even at 5-8% CPU usage.
    The fans themselves are much quieter because they're brand new. But you can still hear the hums and whirs and it drives me nuts. More seriously, my iMac is now narcoleptic. If I use it too long (a few hours on a stretch) it will put itself to sleep, apparently because it thinks it is overheated. And when I use Photoshop or Illustrator, the awake time is even shorter. Depending on the outside temperature, at the most I can only use them for about an hour at a time. Two days ago we had heat wave, and even with the air conditioner running full blast in my study, the iMac kept falling asleep within minutes of using Illustrator.
    Right now I am using TextEdit and no other program is running. Uptime is 59 minutes, average CPU 9.6%. CPU T-Dio is at 168.8F, hard drive 117.5F, CPU fan at 4400 rpm. I am out of ideas and before I do something drastic to this machine, if anyone knows what's going on with my iMac (I know every case is different), please help!
    iMacG5 ECM 2056   Mac OS X (10.4.9)   20"/2.0GHz Power PC/1.5GB DDR SDRAM/250GB
    iMacG5 ECM 2056   Mac OS X (10.4.9)   20"/2.0GHz Power PC/1.5GB DDR SDRAM/250GB

    I do not have the solution... but the same problem with a nice iMac G5 purchased in July 2005.
    My Mac operated very silently untill 6 month ago;problem MAY ( I am not sure) have started when I upgraded to 10.4.10 ; even with few applications and low CPU usage (80% or more inactive), it seems that I have the following regrettable chain of events;
    ==> the CPU temperature is quite high ( 60°c to 72°c most of the time, ie 140-160 °F)
    ==> resulting in fan turning at high speed ( 2.000 for CPU and system, 2500 for HD), and changing speed all the time
    ==> resulting in a noisy computer
    I am SURE this was not the case 6 month ago, and I suspect it is linked to my upgrade to 10.4.10.
    I did all sorts of reinstall, authorization repair, SMU reset, fan clean-up with no sucess.
    iMac G5 (2005)   Mac OS X (10.4.10)   POwerbook G4 Titanium (2001)

  • Basic question with measures & MDX

    Is there a way tell Essbase not to rollup a measure for example if at the lowest customer ID we did a calc X*Y but we don't want the parent customer to aggregate the sum of all of it's children for that one measure...For example if you had a parent and you gave each customer a rating according to sales turnover, when you get to the parent, you don't want to add all the sales turnover %s together, you might do a weighted avg.
    Thanks
    Heather

    Hi Gary,
    Thank you for responding.
    I am finding the syntax for MDX to be much more "challenging" than the Essbase syntax. I miss having the 2 pass.
    Here is the formula:
    case
    when [drawn/undrawn].currentmember=[drawn] and isleaf([customer].currentmember) then [amount]*[risk PCT]*[corp PCT]
    when [drawn/undrawn].currentmember=[drawn] and (not isleaf([customer].currentmember)) then [amount]*[risk PCT]*[corp PCT]
    when [drawn/undrawn].currentmember=[undrawn] and isleaf([customer].currentmember) then [amount]*[Commited PCT]*[corp PCT]
    when [drawn/undrawn].currentmember=[undrawn] and (not isleaf([customer].currentmember)) then [amount]*[Committed PCT]*[corp PCT]
    end
    Basically I need it to calc at level 0 and then roll up for anything not level 0. Now it is SUPER slow. I know it's the isleaf, but not sure what else to do. I tried islevel(customer,0) but didn't work. The customer dimension is HUGE!!! 154000 members stored.
    The data loaded at level 0 for drawn, customer, product, measure, period, year, Costcenter. I just want it to calc at this level and roll up only this portion of the calc. My issue is at level 1, etc it is still doing the amt*risk PCT* Corp pct. Which ultimately is giving us ridiculous answers.
    I pinged some of my colleagues and they said "yeah, this is why we try to do BSO when possible" There has to be a simple way to do this...it's not that complex of a calc....
    Thanks so much for any insight!!!

Maybe you are looking for

  • Query help, subtract two query parts

    Hi, I am beginner of PL/SQL and have a problem I couldn't solve: Table (op_list): Item     -     Amount -     Status Item1     -     10     -     in Item2     -     12     -     in Item3     -     7     -     in Item1     -     2     -     out Item2 

  • Not all of my playlists will sync?? not smart playlists??

    Hi, so i made a playlist on my itunes, it's not a smart playlist, and it wont sync to my iphone 3G. it's not just that one that wont sync its one or two other too. Also, i just bought some songs on my itunes on my computer and those songs wont sync e

  • Itunes store unknown error (-3212)

    How do I resolve itunes store unknown error (-3212)?

  • Building linkable navigation within an indesign document when exporting to pdf

    I'm working in InDesign CS3 and wondering if there is a way to create a linkable navigation in the program when exporting it to pdf. Also, how, if its possible, do I build an html file out of an InDesign document or exported from ID as a pdf?

  • Dump error in select query

    Hey Gurus, i am working on a requirement in which select query is fetching 8 fields from a ZTABLE. IF NOT IT_ZQAPP1[] IS INITIAL.   SELECT AUFNR VORNR PROBNR PIPENO NVORNR SHIFT   PSTAT PRODAT FROM ZQAPP INTO CORRESPONDING FIELDS OF TABLE IT_ZQAPP_B