Is it possible to define a range for JProgressBar ??

I want to set a range on JProgressBar. Let's say I want to set red color for "30%" of progress bar to "70%" of progress bar.
If i do:
JProgressBar progressBar= new JProgressBar(JProgressBar.HORIZONTAL);
          progressBar.setBackground(Color.yellow);
          progressBar.setForeground(Color.red);
          progressBar.setMinimum(0);
          progressBar.setMaximum(100);
          progressBar.setValue(30);
// it will paint till 30% of the bar.
progressBar.setValue(70);
// it will paint from beginning of bar to 70% of the bar.
Is it possible to paint from value 30 to value 70. (is it possible to do it my defining our own class which extends from JProgressBar ??? I tried but was not successful)
any help would be appreciated.
regards,
Kumar

Hi,
try this ;-)
JProgressBar progress;
public synchronized void addProgress (int newValue) {
   for (int i=progress.getValue(); i<=newValue; i++)  {
      progress.setValue(i);
      try  { Thread.sleep(20);  }
       catch (InterruptedException e)  { }
    progress.setString (newValue + " %");
}

Similar Messages

  • Define a range for JProgressBar

    Is it possible to define a range for JProgressBar object ??
    I want to paint a progress bar from say 30% to 70% with a color say "green".
    If i do:
    JProgressBar progressBar = new JProgressBar(ProgressBar.HORIZONTAL);
    progressBar.setForeground(Color.green);
    progressBar.setValue(30);
    // it paints till 30% of the progress Bar
    progressBar.setValue(70);
    // it will paint from start to 70% of the progress bar.
    Is it possible to extend JProgressBar classs and define our own MyProgressBar Class which does this task ??? I tried but was not able to succeed.
    any help would be appreciated
    regards,
    Kumar

    I'm not sure what the request is. Are you asking for a process bar where the entire bar changes color within a certain range (not too hard). Or a progress bar whose bar could be multiple colors at the same time?

  • User defined Number range for TD Bulk Shipments

    Hello,
    By defining Customer specific logic with certain conditions through Z table, can we have a user defined Number range for TD Bulk Shipments? As SAP std. either we can have internal number range or external. If external is opted for, then every time User has to specify the same while creating a Shipment in O4F1. There is a every chance that Users will commit mistakes. In order to avoid this can we have something automatic (i.e. System will take care).
    e.g. In SD Billing we have one User exit:- USEREXIT_NUMBER_RANGE (Module pool SAPLV60A, program RV60AFZZ). With this and depending upon certain conditions (which are maintained in Z table) we can have our own number range.
    Similarly, Can any one please suggest either a User Exit or  BAdi or some enhancement point for this requirement?
    Regards,
    Aniruddha.
    Edited by: Aniruddha Saraf on Jan 3, 2008 2:28 PM

    Hi Anirudhdha,
    There is no standard exit for number ranges like those in SD. However, you can try using the exit EXIT_SAPMOIGS_001 for this purpose. You will still need to enter internal number range in the shipment type configuration.
    Hope this helps,
    Regards,
    Ashutosh

  • Define Number Range for Reference Number

    Hi all,
    I am trying to maintain Different Number ranges for Loans in ESS.
    Once i maintain Define Number Range for Reference Number in Loans ESS and trying to raise a new loan from ESS is till see that the ref number is still displayed 0 while raising the New Loan.
    No        From Number       To Number
    10       
    I maintained range for number range number 10.
    Pls suggest me on this.
    The above scenario works for claims but not for Loans
    Regards
    Vijay

    Solved my self...!

  • Problem--Define number range for cProjects projects

    Hi,
    Does anybody knows how to define/create number range for projects in cProjects?.
    In the standard cPrjects frontend system, the system is taking 16 digits number automatically so i want to define my own number range as required by the client.
    Hence please let me know if some knows abt how to define number ranges for projects in cProjects system.
    You can also reach me on [email protected]
    Thanking you,
    Cheers,
    Suresh Nagaraja

    Hi Suresh,
    don't think there is a standard functionality for this. But you could create your own number range object and fill the data via BAdi. Try DPR_ATTRIBUTES.
    Cheers
    Thorsten

  • Define Number Range for Manual Planning

    Dear All,
                   How Can I define number range for manual planning?
    Thanks & Regards,
    Mahendra Gupta
    Moderator: Please, search before posting

    Hi,
    Please follow below path:
    SPRO>IMG>Financial Supply Chain Management>Cash & Liquidity Mgmt>Structuring>Manual Planning> Define Number Range (OT20)
    Br,Vivek

  • How do you define a range for an axis in autoscale?

    Hello All,
    I found that the autoscaling is  too "tight" with my data and i'd like to define a range on the autoscaling so that I constantly have the same space between the data and the top and bottom of my y-axis. i've looked but couldnt find a way to do it. Can anyone help please?
    Thank you in advance,
    Frederic

    If that's not loose enough, you have to do it yourself.  Turn off auto scale, and set Y min and Y max to the min(data)-cushion and max(data)+cushion, respectively.  This is possible using property nodes for the graph.
    Tim Elsey
    LabVIEW 2010, 2012
    Certified LabVIEW Architect

  • Define Number Ranges for Maintenance Plans

    Dear Friend's,
    At present Maint.plan category PM (Maint order) is not assigned to Group (Maint Plan Number)
    Here i have to define Internal Number Range for Maint.Plan
    How i can assign.Pls guide me step by step.
    Thanks in Advance.
    Regard's
    Sandeep Theurkar

    hi
    Either you can use the existing number by assigning your category to the available group or create your own group and assign the plan category in T code IP20
    in IP20 select the group in change mode ,select your PM category and tick mark the available group and press the element/group button
    or from the menu Group>Insert maintian your own and assign your category
    regards
    thyagarajan

  • Problem when define Value range for data element

    Dear
    When I define a new data element in ABAP Dictionary, for example, ZDATA_ELEMENT_TEST.
    I use domain ZDOMAIN_TEST.
    (Data type is DEC, the length is 10, and decimals is 2 with sign.)
    Now, I want to restrict that, user can ONLY input the value from 10 to 100.
    From ABAP course and the Internet, I switch to "Value Range" tab, and define 10 for Lower Limit, 100 for Upper Limit in Intervals section.
    And write the simple program.
    PARAMETERS test TYPE ZDATA_ELEMENT_TEST.
    WRITE: test.
    And run it.
    Line: -
    But, there is a problem.
    When I input 200 for test, the program still run and display 200 to screen without any error report or notification. The ABAP runtime system doesn't check the input value.
    I want to config for the domain that can satisfies, if the user input the wrong value (e.g: 200 in the previous case), the program will auto raise the error report, or exception, or sth like that.
    Any help is welcome.

    Hi Hanni,
    Welcome to forum.
    Try to attach key word VALUE CHECK to your PARAMETER statement.
    I.e:
    PARAMETERS test TYPE ZDATA_ELEMENT_TEST VALUE CHECK.
    Note: The addition VALUE CHECK cannot be used together with the additions AS CHECKBOX, RADIOBUTTON, or NO-DISPLAY.
    Regards,

  • Is it possible to define specific format for document such as , PO,SO,JV ?

    Hi !
    Actually i am new to EBS. Just we are in the implementation stage now.
    Actually i want to know that whether it is possible to customize the standard format of PO Number or SO Number or GRN No that is there in oracle EBS to My desired format.
    For Example:
    Purchase Order Number format like CO10Y-XXXX
    Sale Order Number format like ES10Y-XXXX
    Journal Voucher like JV10Y-XXXX
    Thanx.

    Hi !
    Actually i am new to EBS. Just we are in the implementation stage now.
    Actually i want to know that whether it is possible to customize the standard format of PO Number or SO Number or GRN No that is there in oracle EBS to My desired format.
    For Example:
    Purchase Order Number format like CO10Y-XXXX
    Sale Order Number format like ES10Y-XXXX
    Journal Voucher like JV10Y-XXXX
    Thanx.

  • Any possibility to define variable limits for alarms

    Hi,
    I need to define variable LO and HI limits for alarms. That is, these LO and HI limits should be linked to different tags.
    In the tag configuration editor, we can only give constant values to the LO and HI limit fields. Is there a way to associate tags to these fields, instead of constant values?

    Hi helene.
    My implementation to this was to use the tag Attribute VI's and have a seperate program that checks that the current HI or LO value with that of a tag storing my HI set point and another Tag Storing my LO Set point. If there is a diffrence in value, the appropriate alarm level gets changed to match the current value.
    How are you changing your values? I have a slider on the front panel that triggers and event on change to update the tag.
    However a point you may or may not have noticed is that if you change the LO or HI value using the Tag Attribute VI's on one computer, this change is not carried across to others. You will have to programatically run the update program mentioned above continuously on every computer running the system
    This is a very large mine field that you will have to take extra care of. Think about what would happen on startup of the various clients, will there be a point when your computers fall out of sink with each other? will the current alarm set points be reatined when the computer is shut down and restarted?
    I sent a very long time coming up with some solutions for all these problems. Which way you chose to do this depends on:
    Number of computers
    Frequency of limits changes
    Number of tags you wich to change
    Whether you system is server client or multi server based.
    Let me know If you want to know more.
    Later
    Phil McD

  • It is possible to define the ranges of the quantities?

    I have this chart, i put this ranges(300,350,400,450,500,550,600,650,700)
    !http://img242.imageshack.us/img242/8468/rangosn.png!
    I want to show ranges per 100(300,400,500,600,700)
    i found in the documentary and i didn´t find nothing.
    This is my code chart
    chart:
    <Graph depthAngle="50" depthRadius="8" pieDepth="30" pieTilt="20" seriesEffect="SE_AUTO_GRADIENT">
    <LegendArea visible="true" />
    <SeriesItems>
    <Series id="0" markerType="MT_BAR" color="#eea16b"/>
    <Series id="1" markerType="MT_BAR" color="#fae48f"/>
    <Series id="2" markerType="MT_MARKER" color="#821616" lineStyle="LS_SOLID"/>
    </SeriesItems>
    <Y1ReferenceLine>
    <ReferenceLine index="0" visible="true" lineWidth="3" text="Media de Aragón" value="500.0" displayedInLegend="true" lineColor="#ff11"/></Y1ReferenceLine>
    <Y1Axis axisMinAutoScaled="false" axisMinValue="300" axisMaxAutoScaled="false" axisMaxValue="700"/>
    <LocalGridData colCount="{count(xdoxslt:group(current-group(), 'Competencia'))}" rowCount="2">
    </LocalGridData></Graph>
    thanks

    Hi Benito
    I need to understand better what you want to see. So if you have
    300,350,400,450,500,550,600,650,700
    does that mean you actually want to see a chart with
    0-300(1),
    301-400(2)
    401-500(2)
    501-600(2)
    601-700(2)
    So really a count of the values in those ranges? Can you explain a bit further?
    Thanks
    tim

  • Is it possible to define one language for every imported text? And other problems when placing text.

    Problem is, that Indesign cc 2014 does not recognize language correctly. In my case it should always be slovenian (and documents like doc and docx are set to slovenian), but it set it as slovakian. I get many documents from different programs (Word, Libre Office, Open Office ...). And setting every one after placing it into document is time consuming. Word import was working great in InDesign 5.5. Now it just mixes local character formating. Also: importing docx takes too long, and when in document is some picture, it just freeze. So I must first open every doc/docx file and delete every picture/logo that is inside.
    Any suggestions?

    Check the language of your default Character Style. If it's set to Slovakian, change it to Slovenian with no documents open.

  • Seperate number range for outgoing & incoming documents in the cash journal

    Hi all:
    i want to know is there a method to have seperate number range for outgoing & incoming documents in the cash journal,I saw that there is  a numbering group in ECC6 and i created a numbering group for both incoming & outgoing as well as i define number range for them,and when i tested it always takes the number range of the document type assigned in transaction FBCJCO.
    define number range of the numbering group in T.C : FBCJC6

    HEllo,
    It's not possible to assign this different number ranges:
    If you check the SAP note 532888  you'll see the following:  
    " - Different number ranges for receipts and expenditures                                                                          
    For reasons of clarity, this is not provided - there are already
    two numbers per cash journal document (fields POSTING_NUMBER as 
    well as D_POSTING_NUMB)."
    Regards,
    Renan

  • Alphanumeric number range for object QMERKRUECK

    Hi all
    I have raised a question on number range object QMERKRUECK few days back.
    Internal number assignment for object QMERKRUECK (numbers are in critical area)
    With reference to the same please let me clear, if it is possible to create alpha numeric number range for the same object.
    I tried in SNRO but system does not allow for this.Next is , if any userexits are there to achieve this.
    I know, this issue is hardly seen in any implementation but if anybody has gone through this and got a proper solution, please share your experience.
    Regards
    D Mohanty

    Hello,
    You can define number range for Purchase requistions in OMH7 transaction agaist each number range number and you assign can assign these number range number to your purchase requistion document types in SPRP >> Materials management >> Purchasing >> Purchase requistion >>Define doucment type.
    E.g for NB doc type number range number is 20
    and in OMH7 number range number 20  has interval from- 2000000000 to 2099999999
    same way
    for RV doc type number range number is 21
    and in OMH7 number range number 21  has interval from- 2100000000 to 2199999999
    Regards,
    Shailesh

Maybe you are looking for

  • Not Sure why this is not working

    hi all, Version details : Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production PL/SQL Release 11.2.0.2.0 - Production "CORE     11.2.0.2.0     Production" TNS for Solaris: Version 11.2.0.2.0 - Production NLSRTL Version 11.2.0.

  • Scheduled report is failing to be triggered via email in SCOM 2007 R2.

    Hi All, I have this strange issue. I have created a scheduled report from the SCOM reporting. It is a default report which comes in SCOM, It is the Most common alerts available in the Microsoft generic report library. I also have the SMTP server conf

  • How to handle the reservtion pending in closed period

    Dear All, Please guide in the following issue. User has created the production orders in the month of April, but against some of the orders  they have not issued the material so these are lying in the reservations. Now we are into June month. I know

  • Apex_collection not being updated?

    Dear all, I have created a collection. When i fill a value and click on the 'vorige' button, i'm being diirected to a different page. When i come back to the page with my collection, I don't see the values I've inserted. I have searched the forum, an

  • Uninstalling apps by means of time machine?

    Hello. Please advice whether it is possible to uninstall apps by means of reverting to older version of Applications folder? I know I can revert to older version of Application folder in time machine backups but would that be sufficient? I am not sur