Setting fonts and Background color
Hi,
Is there anyway to set the font and background color on a jLabel? Thanks for your help!
...emmmm lets see... for the font and the background...
maybe setFont and maybe setBackground!
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JComponent.html
Similar Messages
-
Disabled font and background color
I am trying to change the font and background color of a disabled h:inputtext tag. Currently, if I set disabled=true on an h:inputtext tag, the background in gray and the font is white. I would like to somehow customize that to be background gray and font color black. Any ideas?
Check these
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ccb6bcf4-0401-0010-e3bc-ec0ef03e13d1
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d2b1d790-0201-0010-25b7-d1fb059a8ad9
Regards, Anilkumar
P.S : https://www.sdn.sap.com/irj/sdn/advancedsearch?query=theme&cat=sdn_library
Message was edited by:
Anilkumar Vippagunta -
How to set text and background color of current row in a adf table?
Hi,
In jdev 11.1.2.3,
How to set text fond and background color of current row in a adf table?
I tried to set Background color in table property, but that is not what i want.
Thanks.Hi,
We almost had the same requirement, but we just needed to color a specific column.
Here goes the solution to that, you might do the same for your row highlighting
Changes are required in jsff and one method to be added in backing bean
1. JSFF :
<af:column headerText="Amount"
id="c4" width="100"
inlineStyle="#{backingBeanScope.BackingBean.cellColor}">2. Backing Bean
//searchResultTableVO is Table's VO
public String getCellColor() {
FacesContext ctx = FacesContext.getCurrentInstance();
ExpressionFactory ef = ctx.getApplication().getExpressionFactory();
ValueExpression ve = ef.createValueExpression(ctx.getELContext(), "#{row}", FacesCtrlHierNodeBinding.class);
FacesCtrlHierNodeBinding node = (FacesCtrlHierNodeBinding)ve.getValue(ctx.getELContext());
Row row = node.getRow();
if(row.equals(searchResultTableVO.getCurrentRow())){
//You can add your inline style for font-style too
return "background-color:Red;";
return null;
}Hope this is helpful :)
Regards,
Neha.. -
Tableview Cell - setting the font and background colors
Hi,
I am developing a BSP with a Tableview. The user asked me about displaying a row with a diferent color (font or background) when some data changes on this table.
I am thinking about using a Tableview Iterator to evaluate the content of a cell... but I dont know if I can change the look and feel of the row on where this cell is.
Has someone dealed with this? Can you tell me how?
thanks
ArielActually this is the whole purpose of the Iterator.
I would suggest you take a look at the SBSEXT_HTMLB and SBSEXT_TABLE BSP Application as well as the following weblogs.
/people/thomas.jung3/blog/2004/09/15/bsp-150-a-developer146s-journal-part-xi--table-view-iterators
/people/sap.user72/blog/2004/09/07/bsp-howto-exploring-bsp-development-and-the-miniwas-620
/people/sap.user72/blog/2004/08/27/bsp-howto-tableview-iterator--column-header-graphics
/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator
In those examples you'll see how easy it is to alter the content of the current cell or a cell with a specific value and output anything from graphics to input fields or dropdown boxes or even just change the text, color and styles of the content. -
Changing font and background color for all components
Hi,
This is my first time writing a GUI, and I'm pretty new to Swing and Java. I just recently switched from C++, and so far Java seems to be doing a nice job =)
Currently I have a gazilion components (textfields, labels, panels) and I'm wondering if there is a way to change their background/foreground colours without adding in setBackground/setForeground for every single component.
I've done some researching onto using Look and Feel, but there aren't any current ones that suits my needs. And everyone seems to mention that programming your own is pretty complicated.
My boss wants a slick white text on black background interface, so you can imagine that he's not very impressed with the current default greyish colours =)
Thank you for any help!
CindyHi Cindy,
I'm not sure how effective a solution this will be, but you could try:UIManager.put("TextField.background", Color.BLACK); // Default text field background becomes blackThere are many more defaults you'd have to change and could probably achieve it more reliably and simply by creating or editing the properties file that controls the way the look and feel (even if it's the default) is implemented. Take a look at:
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/UIManager.htmlHope this is helpful
Chris. -
How to change the font and background color in PowerShell
From your error messages to your output parameters, changing the colors of different PowerShell variables and outcomes is a straightforward and useful way to customize your PowerShell console. You can quickly identify ouputs, error messages, parameters and more with simple color cues – and when you're dealing with a longer script, being able to quickly identify anything is a huge help.In aguide on how to configure and customize your color settingsin PowerShell, Petri walks through each and every step, and even donates some of itsown custom PowerShell color themes scripts. (It should be noted that this only works for PowerShell console and not PowerShell ISE.) You can access your color configuration by entering:Powershell$host.privatedataThis will pull up a list of all your colors as they are currently set.Image credit:Jeff HicksNow...
This topic first appeared in the Spiceworks CommunityUse a custom Renderer. This is the JTable tutorial:
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html -
Setting font and color TextItems
This script is failing to set font, and how can I set font color?; I am new to PS Scripting:
var originalUnit = preferences.rulerUnits
preferences.rulerUnits = Units.INCHES
var docRef = app.documents.add( 11, 17, 300, "Test", NewDocumentMode.CMYK)
MyLayer = docRef.artLayers.add()
MyLayer.kind = LayerKind.TEXT
var myFont = app.fonts.getByName("ArialMT");
// Set the contents of the text layer.
var textItemRef = MyLayer.textItem
textItemRef.font = myFont;
textItemRef.size = UnitValue(36, 'pt');
textItemRef.font = '_Aviano-Regular';
textItemRef.style = "Italic";
textItemRef.contents = "Sample Text";
// Restore original ruler unit setting
app.preferences.rulerUnits = originalUnit
ThanksThe font needs to be the postscript name, this will give you a list of them.
var Dlog =
"dialog{text:'Script Interface',bounds:[100,100,500,270],"+
"FontName:DropDownList{bounds:[30,40,370,60]},"+
"PostScriptName:DropDownList{bounds:[30,100,370,120]},"+
"statictext0:StaticText{bounds:[40,10,200,30] , text:'Font Name'},"+
"statictext1:StaticText{bounds:[40,70,141,87] , text:'Postscript Name'},"+
"button0:Button{bounds:[140,130,240,150] , text:'Ok' }}";
win = new Window(Dlog,"Use the Postscript Name in your script.");
var item;
var item2;
for (var i=0,len=app.fonts.length;i<len;i++) {
item = win.FontName.add ('item', "" + app.fonts[i].name);
item2 = win.PostScriptName.add ('item', "" + app.fonts[i].postScriptName);
win.FontName.selection = win.FontName.items[0] ;
win.PostScriptName.selection = win.PostScriptName.items[0] ;
win.FontName.onChange = function() {
win.PostScriptName.selection = win.PostScriptName.items[parseInt(this.selection)] ;
$.writeln(win.PostScriptName.items[parseInt(this.selection)]);
win.PostScriptName.onChange = function() {
win.FontName.selection = win.FontName.items[parseInt(this.selection)] ;
win.center();
win.show();
Here is your code with colour addded...
var originalUnit = preferences.rulerUnits
preferences.rulerUnits = Units.INCHES
var FillColor = new SolidColor;
FillColor.rgb.hexValue = 'ff0000';
var docRef = app.documents.add( 11, 17, 300, "Test", NewDocumentMode.CMYK)
MyLayer = docRef.artLayers.add()
MyLayer.kind = LayerKind.TEXT
var myFont = "ArialMT";
// Set the contents of the text layer.
var textItemRef = MyLayer.textItem
textItemRef.font = myFont;
textItemRef.size = UnitValue(36, 'pt');
textItemRef.font = myFont;
//textItemRef.style = "Italic";
textItemRef.fauxItalic = true;
textItemRef.contents = "Sample Text";
textItemRef.color = FillColor;
// Restore original ruler unit setting
app.preferences.rulerUnits = originalUnit -
How to set Analysis graphics background color to Transparent? not White.
How to set Analysis graphics background color to Transparent? not White.
thanks
Edited by: user13257485 on 2010-8-15 下午11:53
Edited by: user13257485 on 2010-8-15 下午11:55Hi,
We almost had the same requirement, but we just needed to color a specific column.
Here goes the solution to that, you might do the same for your row highlighting
Changes are required in jsff and one method to be added in backing bean
1. JSFF :
<af:column headerText="Amount"
id="c4" width="100"
inlineStyle="#{backingBeanScope.BackingBean.cellColor}">2. Backing Bean
//searchResultTableVO is Table's VO
public String getCellColor() {
FacesContext ctx = FacesContext.getCurrentInstance();
ExpressionFactory ef = ctx.getApplication().getExpressionFactory();
ValueExpression ve = ef.createValueExpression(ctx.getELContext(), "#{row}", FacesCtrlHierNodeBinding.class);
FacesCtrlHierNodeBinding node = (FacesCtrlHierNodeBinding)ve.getValue(ctx.getELContext());
Row row = node.getRow();
if(row.equals(searchResultTableVO.getCurrentRow())){
//You can add your inline style for font-style too
return "background-color:Red;";
return null;
}Hope this is helpful :)
Regards,
Neha.. -
Set current row background color
during post-query process, if record meets condition,
i would like to set the color of entire line.
thank you
[email protected]Hi Jim,
create a visual_attribute named e.g. PQR and set the desired background color.
In post-query trigger:
declare
currec number := Get_block_property('block1', current_record);
begin
if "condition" then
set_item_instance_property('item1', currec,visual_attribute,'PQR');
set_item_instance_property('item2', currec,visual_attribute,'PQR');
set_item_instance_property('item3', currec,visual_attribute,'PQR');
end if;
end;
Good luck,
Monica -
Setting a default background color
Hi All,
I would like to set a default background color for all the
components that I'm going to draw. What is the best
way to achieve this?
Thanks.
SyedYou can set using UIManager of the Look and Feel.
UIManger.put("Button.background", Color.blue);
will set the color of all the JButtons to blue. Like that you can change for all the components you need.
Mohan -
Setting the Border background color
Post Author: gravy
CA Forum: .NET
Hi,
Using the API I'm trying to set the Border background color to transparent but I can't. I want to set the background color to match what the designer does when you uncheck the Background option on the Border tab of a TextObjects properties.
Can anyone help?What release are your using?
do you want to set this dynamically, for one portlet or all. you may what to use
'Themes'
"Jorgeana" <[email protected]> wrote:
>
Does someone have a sample of setting the portlet border and background
color ?
I´m having problems using "setPortletBGColor" !! Tks -
Numeric Control - Text and Background Color changes when operating inc/dec arrows
Hi,
I'm developing an application that has a panel with black background and green or red numbers. I've added numeric controls and configured the text color and text background color attributes accordinglingy. I set the numeric control to hot or validate control mode and show the inc/dec arrows, since I want to be able to incr/decr the numbers.
The problem is that when I run the application and I hit the inc/dec arrows, then the colors inside the numeric control frame become inverted: the black background becomes white and the green number becomes cyan. I've created a callback function assosicated with the numeric control and tried forcing the text and background color, in the EVENT_VAL_CHANGED section, using the SetCtrlAttrribute() function, but to no avail. Also added ProcessDrawEvents didn't help.
When I mouse click again outside the numeric control, then it reverts back to its original colors (green text, black background).
Any suggestions as to how I can fix this ?
I want it to keep its original colors at all times, even when I'm clicking the incr/decr arrows...
Kind regards,
pgriep
Solved!
Go to Solution.Ok, now I see what's happening.
The effect you are seeing is a resul of standard numeric control behaviour combined with the black bcakground: when you use arrows to increment/decrement a numeric control its value will be automatically highlighted; on the default background you'll see the white area and figures highlighted in black (white numbers on balck background). If you set the background to black the system will automatically change the colors used to highlight the text, and that's what you're seeing.
By the way, this does not happens if you use up and down keys on the keyboard: text is not highlighted so colors are not changing.
Additionally, this is not only valid for numerics: see the behaviour of the string controls on the bottom of your panel when you tab up to them. This effect does not happen on controls set as indicator like the big clock in the upper part of the panel.
The only way I can see to overcome this behaviour is to hide control built-in arrows and create your own up and down buttons with which you can manipulate the numeric control. I am attaching a modified version of your project with buttons on the left numeric; sorry for the poor aesthetic: I have used some arrow icons I had on my disk, you may want to create your own arrows with the colors and shape you prefer.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?
Attachments:
ModifiedApplication.zip 9 KB -
Mx|Tree disable hover, selection and background color
Hello.
I would like to know how can i disable the dhover, selection and background color.
i don't need selection at all so if i can just disable the selection in a tree component (plus make the background color transparent) it would be great.
thanksRTFM
Use Tree's "selectable" property and "backgroundAlpha" style. -
How to change foreground and background color using CC SDK?
Hello all,
I am just starting to study the sdk (Mac CC). Currently, I am seeking the answer to change foreground and background color using CC SDK?
Is it possible to do so? In addition, will the Image Mode such as RGB, CYMK or Grayscale be effecting such solution?
Thanks in advance.These are NOT dropdown menus. They are dropdown LISTS.
http://web.me.com/toad.hall/Demo1/Drop_DownMenus.html
And from the links in the Google search you can learn that a list item has no style.
And a dropdown list behaves differently from dropdown menus. Here's how it looks on Mobile Safari : -
Apple Mail color coding both font and background
Is there a way to color-code both the font and the background of emails via Rules? As soon as you set a rule to color code one of them another becomes unavailable. This is probably by design but then I'd say this is very stupid design. I do not see any reason why both can not be set except that nobedy from Apple uses this feature .
Before starting to complain, I have to admit that Mail.app made me switch from other rss and mail applications. It works well and I like having rss and mail in one program.
But I totaly agree with you, I found this post by trying to find a fix for this ugly header. Also it's a mistery to me why the source name is the main title and the subject is the smaller sub title...
And while I'm at it, just one more thing, this rss header or at least the title should be a link. So that if you want to open the selected post in your browser, you don't have to scroll down to the "read more" link.
Maybe you are looking for
-
PDF newbie: image in PDF
I am trying to learn the PDF language and make some PDF files from scratch. I have made some text files which work and now I want to insert some images, but I can't get it to work! I have made a testfile consisting of just an image inserted as an XOb
-
Photoshop CS5 will not start after Outlook
If I start Outlook (Office 2007) as the first application after loading OS (Win 7 Ult, 64 bit), Photoshop CS5 will not open (message: "needs to close down). I then have to log off and in again and start Photoshop before Outlook to get it to work. I s
-
Quality Speakers or Headphones
Can anyone suggest a set of reasonably priced quality speakers I can use to listen to my work? And, where I should buy them. Thanks!!
-
Apple TV - What content is available in Canada??
I tried to download a TV episode from iTunes, and was told I couldn't buy from the US. I was switched to the Canadian iTunes site, and I couldn't find any movies or TV shows for download! What gives? If I buy an Apple TV, does that mean I won't have
-
Can we avoid Skydrive pro synchronization generate hugh traffic?
We are considering provide Skydrive Pro feature to our company users (1,000 internal users). Do Microsoft provide any setting regarding the synchronization mechanism? For instance, the 1000 users have setup sync to same document library. Someone add