Adjusting the color constituents using Scrollbars

Hello, i'm trying to adjust the color gradient of the canvas by varying it using three Scrollbars. i've come up with the following code, but i'm not getting the desired effects. can anyone help me modify the code so that each scrollbar affects one color constituent.
import java.awt.*;
import java.awt.event.*;
public class SimpleScrollBar extends java.applet.Applet
  Canvas can;
  Scrollbar s;
  Scrollbar z;
  Scrollbar t;
  Color bg;
  int b = 0;
  int g = 0;
  int r;
  public void init()
     setLayout(new GridLayout(1,1,10,10));
     bg = new Color(0,0,0);
     can = new Canvas();
     s = new Scrollbar(Scrollbar.VERTICAL,0,0,0,255);
     z = new Scrollbar(Scrollbar.VERTICAL,0,0,0,255);
     t = new Scrollbar(Scrollbar.VERTICAL,0,0,0,255);
     can.setBackground(bg);
     add(can);
     add(s);
     add(z);
     add(t);
  public boolean handleEvent(Event evt)
      if(evt.target instanceof Scrollbar)
        r = s.getValue();
        r = z.getValue();
        r = t.getValue();
        bg = new Color(r,b,g);
        can.setBackground(bg);
      return true;
}

Your problem lies in your handleEvent method. Look at your code, you assign the values of the three scrollbars to the same variable. Also, even if that did work, you mixed up your rgb as rbg.
This should work.
public boolean handleEvent(Event evt)
  if(evt.target instanceof Scrollbar)
    can.setBackground( new Color( s.getValue(), z.getValue(), t.getValue() ) ) ;
  return true;

Similar Messages

  • Can I adjust the color balance in Facetime?

    The color balance of my image when I am using Facetime on my iPad 2 is so bad that I would rather use Skype- it is extremely yellow and makes a very unflattering image of me.  Is there anyway to adjust the color balance to have more natural tones while using Facetime?

    None that I'm aware of.

  • Whenever I try to adjust the color of a scene it gets distorted/squiggly lines.

    Using elements 12; This is my first time editing by the way. Whenever I try to adjust the color of a scene the footage gets distorted/squiggly lines. This is prior to me rendering the footage -- I don't know if that has anything to do with it.

    mrdemiraj81
    Thanks for the reply.
    General
    Are you saying that scenes with and without color correction had those quiggly look?
    Are you aware of the More button at the bottom right of the Lighting Panel expanded? When you click on that, you should have opportunities
    to adjust your settings. Right now you are looking at the More view. Note the Less bottom at the bottom right of the Lighting Panel expanded. You would click on Less to get back to the original view which does not have the adjustments sliders included.
    More Specifics
    Definitely start with the look at unrendered (orange line over content) versus rendered (green line over content).
    Once that is ruled out then we can explore alternative explanation for what you are observing.
    If unrendered/rendered is not the answer, could you post a screenshot of one of scenes with the "distorted/squiggly lines"
    But, if you cannot, written Q&A will have to do.
    1. Can you get the properties of this 4 min promo video - video compression, audio compression, frame rate, interlaced or progressive, file extension, pixel aspect ratio. If you do not have this information, it can be obtained from the MediaInfo (Tree View) program.
    http://mediainfo-mac.en.softonic.com/mac
    Just be careful for unwanted carry alongs during the download and install of MediaInfo. In the MediaInfo (Tree View), please look for what are listed for Scan Type and Scan Order.
    2. Also, please tell us what you see listed in the opened project under
    Edit Menu/Project Settings/General and the readings for Editing Mode, Timebase, Frame Size, and Pixel Aspect Ratio (even if the fields look grayed out).
    Let us start here. If there is anything that you need clarification on, please do not hesitate to ask. I will rewrite if necessary.
    Thanks.
    ATR

  • Is there a way to adjust the color of the Finders file labels?

    is there a way to adjust the color of the Finders file labels?

    Apple has never been good with themes or finder preferences or anything like that. From a marketing and business point of view in the past I would guess they think consistency and therefore exerted brand loyalty outweighs customization, and anyone who really wants to get their own experience will be on linux anyways.
    Nowadays coverflow, expose, smartfolders, aliases and spotlight reduce the need to differentiate between multiple files on the system by a seperate indicator and a colour.

  • How do I adjust the color of a glow/drop shadow in a title?

    Some of the preset styles for text/titles have drop shadows or glow effects in various colors. How do you adjust the color? Say if I wanted the Bell Gothic Ice 26 style, but with a orange glow instead of teal?

    every
    In the absence of further information, I will generalize for now.
    You do your text titles color changes in Color Properties in the Titler. The fill in Color Properties is enabled only after you have added a Style.
    In order for the Stroke to be enabled in Color Properties, you need to apply a Style and that style must have a Stroke in its preset. Please read the details of the Titler's Color Properties in the following Adobe documents
    Adobe Premiere Elements Help | Adding color and shadows to titles
    We will be watching for your follow ups.
    Thank you.
    ATR

  • Make iframe automatically adjust height according to the contents without using scrollbar?

    Hello, 
    I am developing the site (www.meninasreais.com.br) and have a doubt. I created the base html - menu, header - in Adobe Muse. I'm trying to insert an iframe that automatically adjust the height according to the content of the blog.
    I tried with various codes, the frame is installed on the same domain as the site and none of them worked. What can I be doing wrong? Thank you.
    The code that was inserted below:
    <script language="JavaScript">
    <!--
    function autoResize(id){
        var newheight;
        var newwidth;
        if(document.getElementById){
            newheight=document.getElementById(id).contentWindow.document .body.scrollHeight;
            newwidth=document.getElementById(id).contentWindow.document .body.scrollWidth;
        document.getElementById(id).height= (newheight) + "px";
        document.getElementById(id).width= (newwidth) + "px";
    //-->
    </script>
    <IFRAME SRC="www.meninasreais.com.br" width="600px" height="200px" id="iframe1" marginheight="0" frameborder="0"onLoad="autoResize('iframe1');"></iframe>

    Hi, i've successully done this for my blogging engine.
    I've uses jquery.autoheight.js
    In my page property :
    <script type="text/javascript" src="http://www.solutionsip.ca/lib/js/jquery.js"></script>
    <script type="text/javascript" src="http://www.solutionsip.ca/lib/js/jquery.autoheight.js"></script>
    In my html box :
    <iframe id="myframe" name="myframe" class="autoHeight" width="100%" scrolling="no" marginheight="0" frameborder="0" src="http://www.solutionsip.ca/blog"></iframe>
    This work in Adobe muse. My iframe adjust it self with my blog content.
    Exemple : http://www.solutionsip.ca/blog.html

  • CGImage adjusting the colors to reflect an image without a colorprofile

    I have a function which returns a CGImage. The CGImage doesn't have a colorprofile, because its source doesn't use colorprofiles, however I know the equivalent profile of the source and want to add it to a CGImage. I have been able to add the color profile to the CGImage, but then when the image is displayed the colors are wrong. I understand why the colors are wrong, and I have an idea of how to fix it, but I haven't found anything to help.
    Can I adjust an image (or context) to simulate the effect of 'removing' the color profile? is there a function I have overlooked somewhere?
    Thanks for taking the time to look at my question and hopefully help me out.
    Mahalo & Aloha
    Sam Rowlands

    Hi Lieven, I did exactly as you said except it would not allow me to check or uncheck the constrain proportions options. It appears to be unchecked but it does not give me an option to do anything under the Metrics tab. Do you have any idea why? Thanks.

  • Can Preview adjust the color of a whole set of images?

    After a bit of digging, I finally persuaded Preview to load a set of images (of pages from an old book).
    When I try to print it, I find that the pages are basically black-on-dark-gray.  Is there a simple way
    to tell it to change the color balance to black-on-white, short of going through the images one at a
    time and editing the color balance (which could take a lot of time).  If not, is there some other tool
    that will do a reasonable job of doing the obvious sort of "exposure" shift to make a set of images
    of documents not waste a lot of toner painting the background gray?
    (I'm not at all clear on what would be an appropriate forum for this question, so I'm probably
    guessing wrong; could someone suggest a better one? ;-)

    Hi John,
    There are many options for making a gray object black. Here's a few:
    1. Image > Adjustments > Levels... (move shadows pointer)
    2. Image > Adjustments > Curves... (move shadow point)
    3. Control click on your layer (makes selection) fill with black
    4. Use you colour overlay effect layer choosing black as the overlay color
    Paul

  • What is the top right button in the color palette used for

    I've seen several tutorials on different mac apps and when they refer to the color palette I see a oval shape button in the top right corner. Maybe that was in 10.5 or latter but I'm using Lion and there is no oval button in my color palette. I see this in Pages, Pixelmator and Keynote but no oval button showing.
    Thanks in advace

    I've found over the past day that its presence comes and goes, presumably based on background apps.
    As I'm unable to predict when I'll catch it next time, it's best I close this question and I'll reopen a new question when I can provide a screenshot.
    Many thanks for your response, and I'll watch for its reappearance.
    John

  • Can't adjust the volume while using DJ controller

    I've got a DJ controller. I just hopped from Windows to MAC (Pro Retina 13). I basically use Traktor DJ whenever I mix. Normally when I'd quit the program for DJing, the controller kept working - so I could play music via youtube through my speakers.
    And just control the volume overall with the volume keys. Now that I'm on MAC, the DJ program works fine and I can control the master with a knob, but as soon as I quit the DJ program - It plays music through youtube and iTunes just fine, the only thing is it won't allow me to adjust the volume in any way.
    The controller is mapped to a program, I can't use a master knob to adjust the volume out of the program...
    Whenever I try to adjust the volume with the F11 and F12 keys it just shows an O with a slash through it.
    I really want to control my volume through my mixer, please help!!!

    Have you by chance installed an app called "Boom"?

  • How to adjust the color profile on Macbook Pro/IMAC for Brother printers?

    Hi,
    We have both iMACs and MacbookPro w/Leopard 10.5.4 in our office. They also run the Parallels software with Windows XP. We have 2 color printers in the office, a Canon and a Brother 4070cdw. When I make a color print, the output looks very different from the 2 printers. The Brother printer produce very light copies, almost look like there's a white wash over it. I called Brother and went through all kinds of test and they finally said it's not the printer, but the color setting on the Mac. I didn't believe them at first, but then i did a test. I print a color page from the WindowsXP side on my Mac, and print the same page from the Mac side, and the results are very surprising. They look very different, like from 2 different printers; again, the one form MAc is very light.
    I then opened up "system perferences" and tried to play around with the different color profiles under "Display". But the changes did not affect the print outcome much. Please help. Thank you very much.

    To prepare a computer for sale or donation, in addition to the steps mentioned in this support article, take these steps:
    If you set a firmware password, remove it by running Firmware Password Utility in Recovery mode.
    If you activated FileVault in OS X 10.7 or later, turn it off.
    If you use Boot Camp, the partition must be deleted
    If you created any other data partitions on the internal drive, remove them in Disk Utility.
    Erase the data partition(s) with the option to zero out data. An SSD doesn't need to be zeroed.
    You can't legally or practically transfer any software downloaded from the Mac App Store to the new owner of the machine, even if it was free. That includes OS X, so if you paid for an upgrade OS X 10.7 or later, you must reinstall  the original OS, either from the installation media, if applicable, or by booting into Internet Recovery (option-command-R at the startup chime.)
    The new owner will have to repurchase the software, if need be, under his or her Apple ID. If you ever updated the bundled iLife applications (Garage Band, iMovie, and iPhoto) through the App Store, you can't transfer them either.
    Remove the machine from your list of registered products. If it's still covered by an AppleCare Protection Plan, transfer the coverage to the new owner by following the instructions in the AppleCare Terms and Conditions (under the heading "Transfer of Plan.")

  • I can't find the color I used

    Some time ago I made website buttons.  I now need to change the text on top of one of the buttons, but I can't figure out the exact color I used.  The dropper does not pick the original shade.  It seems to be off.  The button was rasterized and saved as a JPEG.  The original PSD file is gone.  I hope I don't have to redo 11 buttons just because I can't find the original color.  Can anyone help?
    I attached a copy of the button.  It is the blue color on top and not the rollover color I need to find.

    The problem comes from the fact that the text is small and there's a lot of JPG artifacting. Even if you find the original color, it will still look off compared to the other buttons while in Photoshop because of the lack of JPG artifacting. You'll likely have to preview the colors using File->Save for Web & Devices set to JPG and a low quality setting.

  • When printing grey scale on a MX882 printer, is the color ink used at all?

    We set all of our home PCs to print gray scale on our printer, an MX882 (serial # ACAT48275) in order to not use so much color ink.  That seemed to be working very well until the big black ink cartridge (the 226BK) emptied out.  I didn't think anything of it because the small 225 BK cartridge was still full.    The 225 BK is about 1/2 full now, but all of a sudden, the color inks (226C and 226M) are empty, with the 226Y 1/2 empty.
    My question is, if the BIG black cartridge (226BK) empties, does it not "switch over" to the 225 BK?  Or does is start "creating" black by using both magenta and cyan?
    Thanks.
    Mark

    Hello.
    If plain, letter sized paper is used, the printer should use the large black tank for grayscale printing.  If specialty paper or duplex printing is used, the printer would use the dye based inks.    If grayscale printing is not enabled, the printer may create 'composite' blacks by using mixtures of the color inks.  This may occur when graphic or web-based printouts are performed.
    The reason for the two different black ink tanks is for the different types of printing your unit is able to perform.  They are not intended as backups to each other.  The larger black tank is pigment based, and is primarily used for standard black text printing or output.  The smaller black ink tank is dye based like the color inks, and is used for photo and graphics output. 
    If additional assistance is needed, feel free to call us at 1-800-OKCANON.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • Adjust the color calibration for your camera

    This question was posted in response to the following article: http://help.adobe.com/en_US/lightroom/using/WS939594D8-4279-41b4-B8E9-B06BC919EC7C.html

    The Camera-centric profiles for Canon, Nikon and some Pentax cameras are Adobe’s attempt to mimic the similarly-named in-camera color modes, but they are only approximate so aren’t some magic bullet to make your photos look like the camera-JPGs.
    Creating one or more custom profiles for your camera is relatively simple, although you’ll need to invest in a standardized color checker calibration target. 
    I use the Color Checker Passport from X-rite, which comes with its own software and LR plug-in to create camera profiles, and then Adobe’s DNG Profile Editor also uses photos of a CC to create camera profiles.  The profiles from each are a little different so it doesn’t hurt to make some from both products to see if one renders better in a particular situation.  You can make one for various lighting situations, even ones that aren’t covered by Adobe-supplied profiles, such as lighting that has a large positive or negative Tint value like Fluorescent and arena lighting.
    http://xritephoto.com/ph_product_overview.aspx?ID=1257

  • Can the color of a scrollbar thumb be changed, to improve visibility?

    Light blue gray on light blue gray is not always easy to see. I have looked, but can't seem to find an add-on for this. I am using 4.0 with the 3.0 for 4.0 theme. I was hoping 4.0 would fix this-- I can't be the only one on Earth who wishes his scrollbars were as easy to find as his tabs. A nice, bright, custom color would make this much easier.

    I appreciate your answer. I tried every reasonable theme there was; the only one that really worked made everything look like Windows '95. Not one of the available themes allowed the scrollbar color to be changed in the Advanced tab-- it just grayed out. I'll keep watching and hoping; someone will, I feel sure, get as bothered as I am-- and have an ability to do something about it. Again, my thanks.

Maybe you are looking for

  • Why do list s:itemRenderer      in sdk 4.5 need a child   fx:Component

    If I do this <s:List> <s:itemRenderer> <fx:Component> <s:HGroup > <s:TextArea text="{data.comment}" height="40"> I get an error  Access of undefined property data

  • Change currency in Stock Transfer

    Dear Experts, One of the client asking option to change currency in inventory transfer. Please help me, how can I? Regards, silambu

  • 에러 -31 문의 드립니다.

    실행 파일을 만들고, 설치 프로그램을 만들 때 다음과 같은 에러가 뜹니다. 원인이 무엇이고, 해결 방안은 무엇인지 궁금합니다. 에러 -31이(가) 다음에서 발생했습니다: 확인되지 않은 위치 이 에러 코드는 정의되지 않았습니다. 여러가지 이유로 인해 정의되지 않은 에러가 발생할 수 있습니다. 예를 들면, 코드에 대해 어떤 설명도 되어 있지 않거나, 에러 코드 입력에 에러 코드가 아닌 숫자를 연결했을 수도 있습니다. 추가적으로, 에러가 OS 또는

  • Changing the table maintenance generator

    hi expert if table maintenance generator is created for a table and after the creation table is changed then how to change the old table maintenance generator? Thanks Avadhesh Moderator message: standard functionality, please search for available inf

  • How to synchroniz​e two analog output with USB-6353 sharing a trigger

    I'm have the need to synchronize two analog output on the same device (USB 6353) sharing a trigger signal on PFI0. The programming environement is Visual C++ , and the code I wrote is as following: DAQmxCreateTask ("", &Ao0TaskHandle);  // is the tas