How to draw a bar with Gradient Color ?

Hi,
How to draw a bar with Gradient Color ? I see
in Java Help about GradientPaint, maybe this
can help ?
Thanks in advance,
Michael

Try to use this in you paint method :
public void paint(Graphics g)
Graphics2D g2D = (Graphics2D) g;
// Get the height & width
int width = this.getWidth();
int height = this.getHeight();
// Create the gradient paint
gradientPaint = new GradientPaint(0,0, Color.blue, width, height, Color.red);
g2D.setPaint(gradientPaint);
g2D.fillRect(0,0, width, height);

Similar Messages

  • How to fill JSlider bar with different color

    I got an problem actually i am in learning state.
    I used Look and feel for windows. UImanager changes the lookandfeel
    But in jslider filled color is blank. how can i change the color&jslider knob is perpendicular to jslider bar how can i fit the knob in jslider bar.pls give suggestions

    Try to use this in you paint method :
    public void paint(Graphics g)
    Graphics2D g2D = (Graphics2D) g;
    // Get the height & width
    int width = this.getWidth();
    int height = this.getHeight();
    // Create the gradient paint
    gradientPaint = new GradientPaint(0,0, Color.blue, width, height, Color.red);
    g2D.setPaint(gradientPaint);
    g2D.fillRect(0,0, width, height);

  • GFW (Grahical Framework) Bar with different colors

    Hello,
    how can I get a bar with differents colors using GFW? I want to do something like this:
    http://image.mathcaptain.com/cms/images/41/stacked-bargraph.PNG
    Thank you very much in advanced.

    Yes. You'll need custom renderers for the bar items. I've seen some examples out there (I think there's one on the flexexamples blog).

  • How to draw a globe with lines of lattitude and longitude?

    I'm using CS4 on a Mac.
    Can anyone tell me how to draw a globe with a grid? I need 7 lines of latitude and 40 lines of longitude (i.e. separated by 9 degrees). I would like to have each segment of the grid defined as shape so I can fill each one with a different color.

    Maybe this way can help.....

  • How to combine a bar with a line in a chart

    Post Author: rbcdexia
    CA Forum: Charts and Graphs
    We want to combine data in bars and with a line showing in one chart.
    Is that possible? How do you configure your chart?
    The line and the bars are based on the values from different fields in the same table.

    Post Author: pareshb
    CA Forum: Charts and Graphs
    We are using Crystal Reports for Visual Studio 2005. Can you please let me know how to combine a bar with a line chart.
    Thanks in advance.Paresh

  • How to draw a shape with line tool then fill with colour

    How can i draw a shape with the line tool and then fill it with colour

    Click and drag from one anchor point to the next, making sure that each new line segment begins where the last one ended. The Line Tool will snap onto the anchors.
    Once you're done creating what looks like a closed path, the lines are still separate objects. To combine them into one path, select them all and press Ctrl/Cmd+J (for Join) or via the menu select Object > Path > Join.
    The Pen Tool can be used in a similar manner, but each segment will be a continuation rather than a separate object. The last (closing) click will be indicated by a tiny circle on the mouse pointer.
    If you make an open path, Ai will still "fill" it with a fill color by assuming a straight path between the last open anchor points. Individual straight paths, however, such as those drawn by the line tool, have no "inside", so they won't show the fill color even if you have assigned one.
    Allen

  • How to align navigation bar with banner?

    Hi i need to align my navigation bar with my banner how can i do this?
    i have attached a picture of how it looks in chrome 1280x1024
    I used Anthony Marchese's guide to do it (http://www.youtube.com/watch?v=l-wuwsZQTl0) but it will not align ive tried everything!!
    also how can i resize a div??
    please help??
    Thanks,
    Gershy14

    THIS IS MY MAIN CODE.
    1  <!doctype html>
    2  <html>
    3  <head>
    4  <meta charset="utf-8">
    5  <title>MusicAtTheD's - the home</title>
    6  <link href="css/styles.css"rel="stylesheet"type="text/css">
    7  <style>
    8
    9
    10  #body {background-image:url(images/washedddd.jpg);background-repeat:no-repeat;background-positi on:center center;
    11  background-attachment:scroll;
    12  }
    13
    14  #navbarOFF li {
    15  font:17px Arial;
    16  display:inline;
    17  list-style-type:none;
    18
    19    }
    20  #navbarOFF a {
    21  background-color:#09F;
    22  color:#fff;
    23  text-decoration:none;
    24  padding-top:15px;
    25  padding-right:28px;
    26  padding-bottom:15px;
    27  padding-left:28px;
    28
    29    }
    30  #navbarOFF a:hover {
    31  background-color:#F90;
    32  color:#666;
    33
    34    }
    35  body {
    36  background-image:url(images/washedddd.jpg);
    37  background-repeat:no-repeat;
    38  }
    39  </style>
    40  </head>
    41
    42  <body bgcolor="#999999"leftmargin="70"
    43  " topmargin="50">
    44  <div id="header"> <img src="images/websitefinalll.jpg" alt="banner" width="752" height="161"></div>
    45  <nav>
    46  <div id="navbarOFF">
    47  <div align="center">
    48  <ul>
    49  <li><a href="#">the home</a></li>
    50  <li><a href="#">the boys</a></li>
    51  <li><a href="#">the gang</a></li>
    52  <li><a href="#">the studio</a></li>
    53  <li><a href="#">the band</a></li>
    54  <li><a href="#">the music</a></li>
    55  </ul>
    56  </div>
    57  </div>
    58  </nav>
    59
    60  </body>
    61  </html>
    62
    CSS SHEET
    1  #body {
    2  background-image:url(images/washedddd.jpg);
    3  background-repeat:no-repeat;
    4  background-position:center center;
    5  background-attachment:scroll;
    6  }
    7  #header {
    8  height:160px;
    9  width:800px;
    10  margin-left:auto;
    11  margin-right:auto;
    12
    13  }

  • Apex 3.2 SVG Chart - How to plot Stacked Bar With Negative Values ?

    Currently Apex 3.2 Flash Chart (AnyChart 3.x) does not support Stacked bars with negative values.
    I try with SVG Stacked bars with positive values only, chart ploting works fine. When I add a new series with negative values (i.e -1) and I get a blank Chart region with no error.
    Based on this statement from Apex's documentation:
    *"AxisLine Indicates zero on charts that have negative values."*
    I appreciate your help on how to translate this statement into action ?
    (i.e how to override .Axisline class in CSS section ?)
    Thank you very much for your time.

    User614143,
    try to add the minumm negative value (but positive) to the parameter for the axis.
    e.g. show value+3000 (assuming -3000 is the minimum value)
    If you don't have a limitation for the negative values, it doesn't work. (or try to calculate first the most negative value in a before header process)
    hope this helps.
    Leo

  • How to save a BufferredImage with RGB color encoded JPEG file.

    Hi, I am new to Java Imaging API programming.
    When I try to write a BufferredImage using following code -
    BufferedImage output = new BufferedImage (width, height, BufferedImage.TYPE_INT_ARGB);
    // Save
    File outputFile = new File("image.jpeg");
    ImageIO.write(output, "jpeg", outputFile);
    It seems that myfile.jpg have CMYK color encoding, Can someone tell me how can I save the BufferredImage with RGB color encoding.
    Thanks,
    Sanjay Ujjainkar

    how to format the text ?
    i have format ted the text but it seems not work!
    Message was edited by:
    Enjoyfans

  • How to make different events with different colors on calendar, on my new iPad

    how to make events on calendar with different colors ?

    Sergio,
    The color of an event is dictated by the color assinged to the calendar it's on.
    Tap Calendars then tap Edit to either changed the color of an existing calendar or to add a new one.
    Matt

  • How to print a plot with two colors Without using two plots

    Hello everybody,
    Escuse my English (poor Frenchies....)
    I'm working with VB6 and I will need to print a plot with two colors (Some values greater than a trigger for example, ...)
    I was looking for some help to discover if that thing is possible without using another plot, this is what I'm already doing, and it do not satisfy me (and my boss....)..
    Thank for your Help.
    Julien

    Hi Julien,
    I have found on the different link to make that you want.
    This first link is on National Instrument site, the first is general, and second provided information about : How Can I Programmatically Print Out a ComponentWorks Graph Object?.
    http://digital.ni.com/public.nsf/websearch/81D87CB2A5BF6C11862569E4008240FE?OpenDocument
    http://digital.ni.com/public.nsf/websearch/dc3430165bc916c586256317006f8cc9
    Links below are on the web, and explain how do you can print a graph on Visual Basic. (the first is French link  )
    http://khany.developpez.com/tutoriel/mschart/
    http://www.programmersheaven.com/zone1/cat378/18546.htm
    Regards,
    Message Edité par Christophe S. le 12-27-2005 01:51 PM
    Christophe S.
    FSE East of France І Certified LabVIEW Associate Developer І National Instruments France

  • How to highlight word(s) with different colors?

    I have Mail, Version 3.2 (919/919.2)
    Re: color
    I see that it is possible to change the color of text and to change the color of the entire field background, but I want to be able to HIGHLIGHT certain words with light colors like yellow, not just change the color of the text.
    Is it possible to HIGHLIGHT word(s) in Mail?
    If so, how? I looked at all the options and read the Help etc.
    Lorna in Southern California
    web.mac.com/lorna6

    OK, outgoing messages. For some reason I thought you wanted to flag stuff in received mail. Mail Tags is certainly not what you want.
    Can you recall what keys or key combinations you used in Tiger? I presume it did more than simply change text to bold?
    If you have selected Rich Text in Mail's Preferences/Composing you can colour the text. Use Format/Show Colors to bring up the floating colour window (if you need it a alot have it up all the time) and when you select some text and click on one of the colours it will be changed to that colour - but not highlighted.
    AK

  • How to draw a table with vertical&horizental lines inSAP-Standard script.

    actuvally my requirement is to place a table in script , if not possible is any posibilitie to draw a table using a vertical lines and horiental lines, if possible can u help me out, and if any sample code r any screen shot u have plz share with me....
    Message was edited by:
            phani kumar

    Hi,
    If have understood your problem correctly , you want to draw a table using script.
    You can refer this link which provides code for <b>drawing vector lines with javascript</b>
    http://www.thescripts.com/forum/thread88771.html
    Next u can also visit
    http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm
    This link contains code for <b>Drawing Table borders using JavaScript</b>
    http://forums.devshed.com/javascript-development-115/drawing-table-borders-using-javascript-44376.html
    Hope any one of them will help you.

  • How to draw xy graph with multiple y axis input?

    Hi,
    I have problem in xy graph, the xy graph only can show 1 signal from the y axis input ( As you can see in the attachment )
    Is it possible to draw xy graph with 2 Y input? Or maybe there are another type of graph that possible to do this? 
    Note:  the x axis should be from an input too ( not versus time / sample ).
    All answer and advice are welcomed.
    Best regards,
    Alvin Chandra 
    Solved!
    Go to Solution.
    Attachments:
    Example.vi ‏139 KB

    Are you asking for a second Y scale on the graph?
    If so, right click on the existing scale, select "Duplicate Scale". This will create a second scale. You can then (if you wish), right click on the new scale a select "Swap Sides" to put it on the other side of the graph.
    Are you asking about adding a second plot?
    If so then you need to bundle your arrays of X and Y points into clusters and build those into an array:
    The X-axis is always from an input on the XY Graph. You just need to change the axis title. Easiest way to do this is to double click on the axis title and type the new name.
    Rob

  • How to draw an arc with width more than 1

    Hi!
    I got the following problem:
    I need to draw an arc under JDK1.1.
    It works fine, but I need to be able to adjust the
    thickness. I didn't find anything in the graphics-
    class.
    Who knows?
    Valentin

    I think you're just gunna have to draw multiple arcs with start/end points that are pixel increments away from each other. In Java2 you could use set the "stroke" with Java 2D, but that's not availale in 1.1.

Maybe you are looking for

  • Apple Remote Desktop and Itunes

    I am using Apple remote desktop to connect to several servers with several users on each server. When Itunes is playing and I try to fast user switch, it will stop playing itunes on the user I am switching from. Is anyone familiar with any problems l

  • "Normal" Network Usage for MacMini Server

    I have a 2011 MMS with a Corei7 proc and 16 GB of ram.  I also have approximately 30 workstations - all mac.  Everything is running Mavericks (server is running server 3.0). All of my users run network accounts.  I've noticed what I would consider su

  • Error when opening page with the web browser activex

    I have downloaded the example for using the web browser activeX component to display a web page. It basically works, but it keeps returning an error (from NI's web site) that I don't see when opening the site from IE. The message I get is: Are there

  • Change XML mode text to mode binary

    Hi guys, In PI 7.0 when i do one call to RFC (RFC Receiver) the message between PI and ECC is a XML mode text. Anbody know how can i change XML mode text to mode binary ? (traffic in my network xml binary instead of xml text) Can anybody help me, ple

  • Qosmio G20-127: Hotkeys & Fn buttons don't work with Vista RC1

    This problem is really annoying me. Neither the Hotkeys(play, pause, forward, record, brightness) nor the Fn Buttons work since I installed windows vista RC1. I need to find a solution for this issue. If anyone has experienced it please provide me wi