Foreground color change from inside a class
Hey,
For a project I'm working on, I wrote a class that extends awt.Label. In this new class, I had to override the paramString() method to return what I wanted it to. This all works great. What I was wondering, is whether or not it was possible to change the foreGround color of the label from inside the class decleration. I was thinking maybe whenever the paramString() method was called. Any help would be appreciated.
Thanks,
Jarrod
Gday,
I you use the mothed setForeground(Color c) it should set the foreground colour (color for you Americans) to what you would like.
see for more info
http://java.sun.com/j2se/1.3/docs/api/java/awt/Component.html#setForeground(java.awt.Color)
or
http://java.sun.com/j2se/1.4/docs/api/java/awt/Component.html#setForeground(java.awt.Color)
if you have jdk1.4
You dont need to make this method in your class just call it when you want. ie
setForground(Color.RED);
or
Color c = new Color(255, 0, 0);
setForeground(c);
Good luck,
Jack 573
Similar Messages
-
I type =25% on my email and sent out, background color changed from white to yellow and =25% changed to %%.
Try leaving a space after the =
Thus: = 25%
Where and when did it change? Did it change inside Thunderbird? Did it change in the Sent folder? Or in a reply to you?
= and % are used in certain types of email encoding; =20% often appears, meaning character 0x20 which is 32 denary or the space character. It is often used where an explicit space would be illegal, and this is common in URLs and other links. I'm thinking that =25% similarly has a special meaning. It ''shouldn't'' get decoded, but software is buggy.
I can't reproduce it here, which is why I'm asking about how and when it changes. Where does the Microsoft software come into it? -
Yosemite load bar color changes / from black to white
Hello there,
is anyone experiencing the same as me?
When booting my MacBook Pro Retina Mid 2012 the load bar color changes from black to white. The color change happens as the keyboard background lights turn on. After this I get to the login screen with the blurred desktop background image (seems normal)
Video: https://vid.me/hOX
(sorry for the vertical video)
I know that the load bar is a feature of Yosemite, but not with the color changes.
I did a clean install of OS X Yosemite with the AppStore download and the Diskmaker X Tool.
Thanks for answers...No
With a very advanced photo editor like PhotoShop and lots of skill you could do that
It is certainly not a simple operation if it is just a B&W image with no color information
LN -
Sorry if thias has been posted somewhere else before.
I'm making a new logo to use in my web-galleries, generated in the WEB-module in LR.
In Photoshop I ensure the background color is #141414 - but when I open the logo in LR 2 (or # for that matter) the background-color reads #191919. The same thing happens when I import the logo through the library-module - the background-colour changes. The logo is made as a RGB PSD-file in the ProPhoto color-space.
How do I avoid this change?
And - if this applies to all my PSD-files imported back to LR there's no point in colormanagement at all!?!
Any help og hints would be so great, as this is driving me nuts.
-s.
Logo-file attachedUnfortunately Jao, yours wasn't.
I'm sorry because of that. Perhaps you should first read up on color spaces. This is a good article. The thing to know is that the numbers you read of the display in Lightroom are not 8-bit numbers in prophotoRGB, but are percentages in a related space which has prophotoRGB primaries and a sRGB tone curve. The working space in Lightroom is linear prophotoRGB. So if you have a color of 14,14,14 in Photoshop (I am assuming those are normal arab numbers in an 8-bit display) in prophotoRGB, the corresponding number in Lightroom would be 6.4% for all three. If your numbers where hexadecimal, the display in Lightroom would show 10%.
Rereading your post, my guess is that you are talking about something else where the actual displayed color changes, so that it is visible to your own eyes. On a correctly setup system this should never happen. As troutmask notes, differences between PS and Lightroom are basically always due to a few things. I. Bad monitor profile. Fix this by recalibrating. II. Incorrect setup in Photoshop. It should be setup to always respect embedded color spaces and the working space should NOT be the monitor profile. III. Failure to include an icc profile on save from Photoshop. III is very common. Make sure that when you save, to include the prophotoRGB profile. Otherwise, Lightroom will assume it is an sRGB file.
Lastly, and I am starting to think that this is your issue, if you are creating a logo for the web, make sure you do it in the sRGB profile (simply do a convert to profile in Photoshop and save it under a different name). On windows almost every web browser (except Safari and the latest Firefox) are not color managed, so they will give weird color if you feed it images in anything else than sRGB. The web module in the windows version of Lightroom uses the IE engine, so you don't get color management in that module. You also don't get color management in flash galleries on any platform. -
Color changes from FCP to Quicktime to Youtube
I'm editing on FCP7 and I add color correction but then the color changes once I export to quicktime conversion. And then it changes again when I upload it to youtube.
I'm editing on Apple ProRes 422 1920 x 1080. I export with quicktime conversion to h264 same dimensions. Please help me out thanks!The color will change. This is due to many factors, like the Canvas in FCP not being color accurate, so it won't match a QT file that you export if you do it with the same settings as the sequence. But it REALLY won't match if you compress it in any way, as compression means information is removed to make the file smaller. Color information.
Here...look at my second to last post on this thread for a reason for all of this:
https://discussions.apple.com/thread/4903886?tstart=0 -
Pantone color changing from Ai CS5 to CC?
I opened up a file originally made in CS5. When I copied it over to a new document, now using CC - the pantone color switched. I'm in CMYK mode and the swatch still displays as Pantone 560 U in the swatch menu. Any ideas as to what is going on?
Rex,
There have been changes in CMYK representations of Pantone colours.
This has caused some inconvenience or worse, especially when working with different versions, or files from other versions.
Apart from that, possible differences in Color Management/Settings may cause differences. -
How do I recerence Movie Clips on the Main Timeline from inside a class?
Hey everyone, this might be a stupid question but I thought
I'd ask cause it's making me nuts. I'm all of 2 days into AS3
(coming from not using Flash at all in YEARS) so feel free to
consider me ignorant. I do have plenty of application development
experience in other areas though.
I can't seem to create a class that can reference an instance
of a movie clip on my main timeline. I'd post code of what I've
tried but I've gone through so many desperate edits & wild
guesses that it was just garbled junk before I deleted it all.
Basically here's how I figured Flash could work, though maybe
it doesn't work this way at all.
I'm assuming that with AS 3 being so big on being a true
object oriented environment, I wouldn't need to mix my code and
interface together. Preferably I'd be using the Flash authoring
tools just to design my interface. Create a button... place it
somewhere... give it an instance name. Roughly the equivilant of
Apple's InterfaceBuilder for those of you that might be familiar
with Cocoa development. I can see maybe having to put a few lines
of ActionScript onto frame 1 (though really I'm hoping Flash would
have a better method of kicking off the application at this point
that using code tied to frames) to load my classes & such, but
after that I'd like all of my code to be held in external class
files.
So maybe I've got:
Interface.fla - My interface
Button_1
Button_2
TextField_1
Main.as - My main controller class using to handle all of my
applications behavior
SomeClass.as - Some helper Class
SomeOtherClass.as - Some helper Class
Main.as would have instructions in its initialization method
to go ahead & attach events to buttons & initialize
anything else that needs to happen when the application starts.
From there on it would all be objects communicating back &
forth. Button_1 would get clicked with would fire
Main.someMethod(). Main.someMethod() would then do it's thing and
set the value of TextField_1. All very clean & code is very
separated from interface.
Unfortunately I can't for the life of me figure out how AS3
classes reference each other like that. There doesn't seem to be
any kind of a global 'root' or '_root' I can use to locate any
movie clips on the stage. I've searched the help & the web for
any kind of simple tutorial but to no avail. My job has tasked me
with building a flash app for a project but I'd really rather not
have a tone of ActionScript just shoved into frame 1. That just
seems... ugh! (::shudder::)
Can someone maybe point me in the right direction here? I'm
really willing to do my homework but I can't seem to locate the
info I need to get started. Also, is there an ActionScript IRC
channel or something maybe?
Thanks,
CliffI worked with the problem last night and the solution I
started coming to involved creating my own custom document class
based off which extends MovieClip. My thought is that way I have
access to the initialization routine of the timeline itself and
that all of the elements on the main timeline should be
"properties" of my custom class.
Is this correct? Is there a down side to doing this & if
so what is it & why?
Also, just for my reference, the last time I did anything
with ActionScript I think I was using '_root' to target the main
timeline. WHat are the global variable names in AS 3? Is it just
'root' & 'stage' or 'Root' & 'Stage' or what? -
Color change from Photoshop to Keynote
I have corrected the color of some images in Photoshop CS2 using a color calibrated monitor, converted the images to JPEG and imported them into Keynote. It was disappoining and unexpected to see a significant shift in color with a greenish-yellow tint and incresed saturation. Why is this happening? How can I correct or prevent it from happening?
What version of Keynote are you using? Version 2 had some known color issues.
-
Colors change from Photoshop to DVD SP
So I've been having this problem for a while now.
My problem is that when I make a layered menu in photoshop and import the PSD into DVD SP the color of the picture is different. It seems to crush blacks and turn more magenta. I've found out that it only does this to PSD files and not JPEG's. I've tried using both maximizing compatibility checked and off .
Proof colors is off and I'm working in RGB 8-bit. I've looked around but can't find any solution to this.
Here is a screen shot:
http://ruwan.panda-co.us/Picture%201.png
Left is DVD SP and right is Photoshop.
Please help!!!!
ThanksGary Scotland wrote:
use the generic colour profile in Photoshop in colour settings.
don't use the NTSC profile, DVDSP must use the generic profile so Photoshop needs to use that also.
Okie dokie. But that apparently didn't help:
Thanks for advice. I changed the color profile. But the images still look different. Here is another
screen shot after the LCD change. It still seems to be a little magenta and is definitely crushing the
blacks. Is this expected when using PSDs in DVDSP?
Changing the color profile of the display does nothing to alter the color space of the source material unless you know how to do that, too; just changes how your display displays the material. Time to evaluate your video using a scope.
bogiesan -
Receive notification of UIView changes from outside that class
Say, I want to know when a specific UIView object receives a notification (for instance, viewDidDisappear:) but I need to know it from outside of that class, or in another class derived from NSObject. Is it possible to do at all?
you can't access anything related to a particular class unless you have access to that class. you don't necessarily have to open the class file and inspect/edit it. but you do need to have a reference to a class instance.
so, if you have a class where you create a class instance, you can use that to "try" and remove that listener (assuming its an instance method). if the listener is a static method, it's even easier. -
Preserve foreground color of selected text
Hello,
I got text like this in a StyledText-Field:
one two three
If this text is selected in Windows, the text color within the selection will be changed to white.
In OS X the text will keep its color even under selection.
Is it possible to have such a behavior in Windows too?I have the same problem.
I've generated a form from designer and i put a template object to a item. This template has a visual attribute to red color on foreground, but when i set the visible property true, the foreground color changes.
I put the code on the same way that you, but i've the same problem. Even, i put the inverse order to code and the same.
My forms version is 10gR2 with patch set 2 applied.
Any idea?? Thank you -
Target movieclip from an AS3 class file - remove/add Child
Halo.
I have a very simple question (for those who use external class files).
Assuming that I have a MovieClip manually added to Stage and I want to access it from inside my class definiton.
So the code would be:
MovieClip(root).MyMovieClip
But I can't figure out how to use remove/add Child in that kind of situation.
I will appreciate any advice.
Thanksif you can reference using that, you can remove using:
MovieClip(root).MyMovieClip.parent.removeChild(MovieClip(root).MyMovieClip);
and you can add to any displayobjectcontainer. -
Trying to make a simple background color change.
I double clicked the foreground/background black and white squares as usual. This brought up the color selector and I changed to the color I wanted. When I clicked ok the foreground color changed to a medium gray instead of the color I had selected?
Are you in Greyscale mode by any chance? Image > Mode > Select RGB.
-
Hello
I am just learning Photoshop CS4 on a Mac.
I selected a color, expecting the foreground color to change to that color so I could fill a an area. I found that the foreground color changed to grey. Whatever I tried it just went grey. Could someone tell me what is happening here. I am doing something wrong but I have no idea what it is.
Thanks for any help with this.Image menu->Image mode->RGB color
You appear to be in grayscale mode now. -
Cursor color change according to background
The default cursor is Black, and black tool-tips (such as slashes, carats, circles, eyedrop, etc...). However, I have trouble tracking down a certain line segment or end-point when I can't see the black slash on the thick black border. All I can do is change the item to white, make my selection, make the connection, then change it back to black. Very time consuming and interrupts the creative flow.
Is there a plug-in or setting so that the cursor color changes from black to white according to the darkness/lightness of the background? Or am I simply SOL?Nope, that stuff is hard-coded. If you have difficulty in detecting thin elements, I suggest you use the colored paper simulation in the doc settings/ prefs and assign som contrasty color temporarily If you e.g. work with black and white, obviously something like a dirty lime green or greenish grey will work perfectly rfor both colors...
Mylenium
Maybe you are looking for
-
Illustrator CS5: The Color Box is showing up with question marks?
Here is a snapshot of my problem: The path highlighted in green is supposed to be dark black, but as you can see on the second snapshot it's in a lighter shade of black. When I click on the Fill & Stroke Boxes to change its color, the path's color wo
-
Weblogic 11g Admin server start up script giving me these 3 lines
I donot know what these 3 lines are coming every time when i start the server. can any body explain me what are these 3 lines [WARN ][osal ] Could not enumerate processes (1) error=-1073738819 [WARN ][osal ] Could not add counter (null)\ for query [W
-
Quicktime using associations in Firefox when they are disabled.
I have been having this problem every time I install Quicktime. The files I view at work are mainly .tif's and .mdi's (Microsoft Document Imaging files). When I install Quicktime suddenly it opens the .tif's I download to view, even though the associ
-
I recently did a software update, restarted my laptop and tried to start Safari, and the icon just bounced and nothing happened. I searched for solutions, including logging in as another user, but nothing is causing it to launch. (Have tried deleting
-
HI Experts, Am getting below error, Error: 1 (Miscellaneous error) 17: Invalid VersionId Error: 2 (Field level error) SegmentID: ISA Position in TS: 1 Data Element ID: ISA12 Position in Segment: 12 Data Value: 004010 7: Invalid code value As my partn