JTextfield background color for one line

Hi everybody,
How can I change the backgroundcolor for one single line in a textfield? I think it's nog possible in an ordinary JTextfield, does anybody know how I can do this?
Best regards,
Jethro

Look at Highlighter

Similar Messages

  • How to give Common Background color for all JPanels in My Swing application

    Hi All,
    I am developing a swing application using The Swing Application Framework(SAF)(JSR 296). I this application i have multiple JPanel's embedded in a JTabbedPane. In this way i have three JTabbedPane embedded in a JFrame.
    Now is there any way to set a common background color for the all the JPanel's available in the application??
    I have tried using UIManager.put("Panel.background",new Color.PINK);. But it did not work.
    Also let me know if SAF has some inbuilt method or way to do this.
    Your inputs are valuable.
    Thanks in Advance,
    Nishanth.C

    It is not the fault of NetBeans' GUI builder, JPanels are opaque by default, I mean whether you use Netbeans or not.Thank you!
    I stand corrected (which is short for +"I jumped red-eyed on my feet and rushed to create an SSCCE to demonstrate that JPanels are... mmm... oh well, they are opaque by default... ;-[]"+)
    NetBeans's definitely innocent then, and indeed using it would be an advantage (ctrl-click all JPanels in a form and edit the common opaque property to false) over manually coding
    To handle this it would be better idea to make a subclass of JPanel and override isOpaque() to return false. Then use this 'Trasparent Panel' for all the panels where ever transparency is required.I beg to differ. From a design standpoint, I'd find it terrible (in the pejorative sense of the word) to design a subclass to inconsistently override a getter whereas the standard API already exposes the property (both get and set) for what it's meant: specify whether the panel is opaque.
    Leveraging this subclass would mean changing all lines where a would-be-transparent JPanel is currently instantiated, and instantiate the subclass instead.
    If you're editing all such lines anyway, you might as well change the explicit new JPanel() for a call to a factory method createTransparentJPanel(); this latter could, at the programmer's discretion, implement transparency whichever way makes the programmer's life easier (subclass if he pleases, although that makes me shudder, or simply call thePanel.setOpaque(false) before returning the panel). That way the "transparency" code is centralized in a single easy to maintain location.
    I had to read the code for that latter's UI classes to find out the keys to use (+Panel.background+, Label.foreground, etc.), as I happened to not find this info in an authoritative document - I see that you seem to know thoses keys, may I ask you where you got them from?
    One of best utilities I got from this forum, written by camickr makes getting these keys and their values very easy. You can get it from his blog [(->link)|http://tips4java.wordpress.com/2008/10/09/uimanager-defaults/]
    Definitely. I bit a pair of knucles off when discovered it monthes after cumbersomely traversing the BasicL&F code...
    Still, it is a matter-of-fact approach (and this time I don't mean that to sound pejorative), that works if you can test the result for a given JDK version and L&F, but doesn't guarantee that these keys are there to stand - an observation, but not a specification.
    Thanks TBM for highlighting this blog entry, that's the best keys list device I have found so far, but the questions still holds as to what specifies the keys.
    Edited by: jduprez on Feb 15, 2010 10:07 AM

  • How to automatically build a table with 2 alternated font colors for the lines ?

    Hi,
    I'm looking for a way to automatically build a table with alternate background color and alternate font color for the lines.
    I have this particular project (a list of companies of an industrial area) and it is updated twice a year :
    I managed to set an automated alternate background color of the lines so this works well (white/blue/white/blue...)
    But the font color does not automatically alternates... and I do not know how to set this up...
    All the companies are ordered alphabetically so when I have to insert or delete one, the whole text of the table under the modified line is messed up. Then I have unreadable white text on white background and blue text on blue background...
    Does anyone have an idea on how to automatically alternate the font color ?
    Thank you.
    Best regards,
    G.

    Hi,
    I know this [JS] code is awful but it works. If  someone wants to correct it …! 
    At the beginning, you have an Excel file. You play a little with it [doing concatenations] to get, after importing it in ID:
    Then, just run the .jsx:
    Done! 

  • Problem in Setting Background Color for JButton

    Hi,
    I am using Background color for JButton (color is selected from the customized JColorChooser created by us) where it contains the option of transparency. If we choose light color, then the background is set to JButton, but when we mouse-over the JButton, other components inside the container (JPanel) is getting displayed inside the button.
    Can anyone help to sort out this problem.
    Thanks in advance.

    Hi,
    Here is the code.
    DialogWrapper is JDialog and ColorEditorPane is JPanel.
    DialogWrapper     dlg         = new DialogWrapper();
    ColorEditorPane colorPanel = new ColorEditorPane();
    colorPanel.setValue( _data.getTransparentColor());
    dlg.showWrappedDialog( colorPanel, "color_help", "color_dialog" );
    if( dlg.isOK())
    Color chosenColor = (Color) colorPanel.getValue().getContent();
    _data.setTransparentColor( chosenColor );
    _transparentColorDisplay.setBackground( chosenColor );
    _transparentColorDisplay.setOpaque( true );
    this.repaint();
    this.doLayout();
    this.validate();
    }I've several components like JCheckBox, JRadioButton, JTextField in "this".

  • Defining a background color for a paragraph style

    Hello and please excuse this very basic question, but I am completely stumped.
    How do I simply define a background color for a paragraph style? I cannot use a table etc. because the styles are mapped during an XML conversion. Code lines should receive a gray background box to separate them from the text.
    Also, is there a way to force line breaks whithin words for a specific style? The text, formated in Courier, should just fill the space with a fixed width per character and break wherever the line ends.

    With some drawbacks it's doable using two paragraph tags.
    The first tag, e.g. "Line" is empty (no text), and it has a reference page graphic that's just a rectangle filled 100% with color and set to have a percentage tint so that the text will "show through" it.
    "Line" is also set to have a negative space below it, e.g. -12 points.
    "Code" paratag has the actual code text in it, and it's set to have a negative space above, e.g. -12 points.
    I've done projects where I have multiple Line paratags differing by the number of code lines needing to be shaded, e.g. Line1, Line2, Line3.
    Unfortunately there isn't a way to automatically have the line expand to the correct depth of the Code paragraph, although I believe this would probably be something that could be done as a Framescript, to run through a document and create new "line" paratags of the correct depth depending on how many Code paragraphs or lines are in the following paratag.

  • Background color for column heading

    Hi,
    I have 5 columns in my report and I would like to have different background color for column headings. How can I do this in report templates?
    I was looking at Column heading section-
    <th class="t10ReportHeader"#ALIGNMENT# id="#COLUMN_HEADER_NAME#">#COLUMN_HEADER#</th>
    How can I specify backgrund colors for all columns here?
    Thanks in advance

    G'day Karen,
    Thanks for ur reply.
    I have seen this note before, its not that the header colors have changed after latest SP was applied in our systems. Also the ABAP and JAVA stacks are in sync.
    Scenario is that we are trying to set up a new Portal theme for Enterprise Reporting with some specific color codes (hex codes).
    What i have observed is Characterstics Header background color is set up using the element "Background Color of Level 1 Column Heading ".
    While the Background color for Key Figures header is using element "Background Color of Level 2 Column Heading ".
    But the problem is element "Background Color of Level 2 Column Heading " is also used as the Background color for Standard Characterstics cell, so if we make it same the whole report of the same color, which we dont want.
    Requirement is to get the same Background color for Header cells (both Char. and Key Figure headers).
    Any further suggestions will be appreciated.
    Thanks
    CK

  • How do I create 2 motion tweens for one line of text?  the text needs to "fly-in-right", I can do that,

    how do I create 2 motion tweens for one line of text?  the text needs to "fly-in-right", I can do that, then it needs to "fly-out-bottom" again, I can do that, but not on the same line of text...any ideas...

    my question
    1- there is any way to assign the Fetch process to specific region so the process take all item in these region only.
    2- how can create manual process to fetch row into specific items in page ( i tray these code
    SELECT col1, col2, col3 ....
    INTO :P1_ITEM1, :P1_ITEM, :P1_ITEM...
    FROM table
    WHERE id = :P_id ) but no data retrieve .
    I do not think that it is possible to have more than one Automated Row Fetch process in a given page. See the thread:
    ORA-01403: no data found : Unable to fetch row multiple automated row fetch
    On your second question, the manual process should work provided:
    P_ID has a value when the process executes. You can do it this way:
    i. Make this process as a on-load After/Before header process
    ii. Make sure that P_ID page item has value when the process executes (set it from another page or before the pl/sql process executes)

  • No Background Color for ALL DAY EVENTS

    Is there a way to prevent the background color from All-Day-Events in iCal? I would prefer to print/view the calendar w/o the background colors.

    No one answered

  • How to set background color for selected days in DateChooser

    How to set background color for selected days. I created
    checkbox for each day [Son,Mon,Tue,Wed,Thu,Fri,Sat] and a
    DateChooser, I want to change the background color for the selected
    day when i click on a button after selecting the desired checkboxs
    [ monthly wise/yearly wise]
    Thanks in advance

    There is no button involved in the following code, but it may
    be of use to you:
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    private var origColor:uint;
    private function init():void {
    origColor = dc.getStyle("selectionColor");
    public function setBackGrdColors(newColor:uint):void {
    dc.setStyle("selectionColor", origColor);
    if(dc.selectedDate){
    var dayOfWeek:Number = dc.selectedDate.day;
    else{
    return;
    switch(dayOfWeek) {
    case 0:
    if(sun.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 1:
    if(mon.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 2:
    if(tue.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 3:
    if(wed.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 4:
    if(thu.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 5:
    if(fri.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 6:
    if(sat.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    default:
    break;
    ]]>
    </mx:Script>
    <mx:VBox horizontalAlign="center" verticalGap="20">
    <mx:DateChooser id="dc" textAlign="left"
    change="setBackGrdColors(cellColor.selectedColor)"/>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="sun" label="Sun"/>
    <mx:CheckBox id="mon" label="Mon"/>
    <mx:CheckBox id="tue" label="Tue"/>
    <mx:CheckBox id="wed" label="Wed"/>
    </mx:HBox>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="thu" label="Thu"/>
    <mx:CheckBox id="fri" label="Fri"/>
    <mx:CheckBox id="sat" label="Sat"/>
    </mx:HBox>
    <mx:HBox width="300" horizontalAlign="center">
    <mx:Label text="Background Color" />
    <mx:ColorPicker id="cellColor"
    selectedColor="#FF00FF"/>
    </mx:HBox>
    </mx:VBox>
    </mx:Application>

  • One PR for one line item in third party sales

    Hi all,
    When we create and save a third pary sales order, the system will create a Purchase Requesition.
    If there are 5 line items in the Sales Order, the system will create only one PR for all the line items.
    I will create only one sales order, and  I want one PR for one  line item of the sales order.
    How to Configure this.
    Regards
    VASU

    Vasu,
    PR in the sales order is generated by the settings in Schedule line and Item category. In a particular sales order, if there are 5 line items and of same item category and schedule line then system will give only one PR number. Again if the item category ans schedule line is different then there will be multiple PRs.
    Can you please elaborate more on your requirement. Again from one PR you can generate multiple PO
    Thanks,
    Raja

  • Set property for  background color for JButton

    I am attempting to change the colors of the UI for JButton. The change does not appear to be taking. The reason appears to be that JButton, and for that matter JLabel setOpaque(false); How can I globally change this to setOpaque(true);
    Second is there a way to save the default property hash table after the changes are made so that it will run the next time the program is executed.

    Thank you for responding. I don't feel that I have been clear in the statement of the problem. I have written a medium size desktop application(20,000 statements). I am trying to customize the color scheme by modifying the default laf properties color entries. I can modify JPanel through a put to the properties hash table. When I attempt to change the background color for JLabel and JButton it doesn't seem to take. I believe that the reason it doesn't take is because opaque(false). Is there a property that allows the overide of opaque to true or do I have to change all of the numerous JButtons in my program.
    I have decided to store all changes in a file and make the changes at the point that the program initializes each time its run.
    I am not looking for specific code but an approach.
    I would appreciate your advice.

  • UITableView: set different background colors for header and the table

    I would like to set my background color for my UITableView to white and set my tableViewHeader backgroundColor to grayColor similar to the facebook app. When I bounce scroll my table so that you can see above the header, then currently it is white above the header view. I want that to be brown instead.
    In the facebook app, above the headerview, it is a blue color and below the table is a white color. If i try and set the UITableView backgroundColor to brown, then the top will be brown, but so will the bottom. Additionally, all of the unset cells will have a brown background instead of white.
    Any help with this?

    Fixed..

  • Can i have the HTMLB Code for the background color for a  screen?

    Hi friends,
    Can i have the HTMLB Code for the background color for a  screen?
    moosa

    Hi:
    you can put like
         <table width="100%" height="100%" cellspacing="1" cellpadding="2" border="0">
                     <tr class="sapTbvCellStd"> <td bgcolor="#B1E1D2" valign="top">
    Regards
    Shashi

  • Set Background color for headers in excel

    DECLARE
       v_fh     UTL_FILE.file_type;
       v_dir    VARCHAR2 (30)      := 'my dir';
       v_file   VARCHAR2 (30)      := 'test.xls';
       PROCEDURE run_query (p_sql IN VARCHAR2)
       IS
          v_v_val   VARCHAR2 (4000);
          v_n_val   NUMBER;
          v_d_val   DATE;
          v_ret     NUMBER;
          c         NUMBER;
          d         NUMBER;
          col_cnt   INTEGER;
          f         BOOLEAN;
          rec_tab   DBMS_SQL.desc_tab;
          col_num   NUMBER;
       BEGIN
          c := DBMS_SQL.open_cursor;
          -- parse the SQL statement
          DBMS_SQL.parse (c, p_sql, DBMS_SQL.native);
          -- start execution of the SQL statement
          d := DBMS_SQL.EXECUTE (c);
          -- get a description of the returned columns
          DBMS_SQL.describe_columns (c, col_cnt, rec_tab);
          -- bind variables to columns
          FOR j IN 1 .. col_cnt
          LOOP
             CASE rec_tab (j).col_type
                WHEN 1
                THEN
                   DBMS_SQL.define_column (c, j, v_v_val, 4000);
                WHEN 2
                THEN
                   DBMS_SQL.define_column (c, j, v_n_val);
                WHEN 12
                THEN
                   DBMS_SQL.define_column (c, j, v_d_val);
                ELSE
                   DBMS_SQL.define_column (c, j, v_v_val, 4000);
             END CASE;
          END LOOP;
          -- Output the column headers
          UTL_FILE.put_line (v_fh, '<ss:Row>');
          FOR j IN 1 .. col_cnt
          LOOP
             UTL_FILE.put_line (v_fh, '<ss:Cell>');
             UTL_FILE.put_line (v_fh,
                                   '<ss:Data ss:Type="String">'
                                || rec_tab (j).col_name
                                || '</ss:Data>'
             UTL_FILE.put_line (v_fh, '</ss:Cell>');
          END LOOP;
          UTL_FILE.put_line (v_fh, '</ss:Row>');
          -- Output the data
          LOOP
             v_ret := DBMS_SQL.fetch_rows (c);
             EXIT WHEN v_ret = 0;
             UTL_FILE.put_line (v_fh, '<ss:Row>');
             FOR j IN 1 .. col_cnt
             LOOP
                CASE rec_tab (j).col_type
                   WHEN 1
                   THEN
                      DBMS_SQL.COLUMN_VALUE (c, j, v_v_val);
                      UTL_FILE.put_line (v_fh, '<ss:Cell>');
                      UTL_FILE.put_line (v_fh,
                                            '<ss:Data ss:Type="String">'
                                         || v_v_val
                                         || '</ss:Data>'
                      UTL_FILE.put_line (v_fh, '</ss:Cell>');
                   WHEN 2
                   THEN
                      DBMS_SQL.COLUMN_VALUE (c, j, v_n_val);
                      UTL_FILE.put_line (v_fh, '<ss:Cell>');
                      UTL_FILE.put_line (v_fh,
                                            '<ss:Data ss:Type="Number">'
                                         || TO_CHAR (v_n_val)
                                         || '</ss:Data>'
                      UTL_FILE.put_line (v_fh, '</ss:Cell>');
                   WHEN 12
                   THEN
                      DBMS_SQL.COLUMN_VALUE (c, j, v_d_val);
                      UTL_FILE.put_line (v_fh,
                                         '<ss:Cell ss:StyleID="OracleDate">'
                      UTL_FILE.put_line (v_fh,
                                            '<ss:Data ss:Type="DateTime">'
                                         || TO_CHAR (v_d_val,
                                                     'YYYY-MM-DD"T"HH24:MI:SS'
                                         || '</ss:Data>'
                      UTL_FILE.put_line (v_fh, '</ss:Cell>');
                   ELSE
                      DBMS_SQL.COLUMN_VALUE (c, j, v_v_val);
                      UTL_FILE.put_line (v_fh, '<ss:Cell>');
                      UTL_FILE.put_line (v_fh,
                                            '<ss:Data ss:Type="String">'
                                         || v_v_val
                                         || '</ss:Data>'
                      UTL_FILE.put_line (v_fh, '</ss:Cell>');
                END CASE;
             END LOOP;
             UTL_FILE.put_line (v_fh, '</ss:Row>');
          END LOOP;
          DBMS_SQL.close_cursor (c);
       END;
       PROCEDURE start_workbook
       IS
       BEGIN
          UTL_FILE.put_line (v_fh, '<?xml version="1.0"?>');
          UTL_FILE.put_line
             (v_fh,
              '<ss:Workbook xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">'
       END;
       PROCEDURE end_workbook
       IS
       BEGIN
          UTL_FILE.put_line (v_fh, '</ss:Workbook>');
       END;
       PROCEDURE start_worksheet (p_sheetname IN VARCHAR2)
       IS
       BEGIN
          UTL_FILE.put_line (v_fh,
                             '<ss:Worksheet ss:Name="' || p_sheetname || '">'
          UTL_FILE.put_line (v_fh, '<ss:Table>');
       END;
       PROCEDURE end_worksheet
       IS
       BEGIN
          UTL_FILE.put_line (v_fh, '</ss:Table>');
          UTL_FILE.put_line (v_fh, '</ss:Worksheet>');
       END;
       PROCEDURE set_date_style
       IS
       BEGIN
          UTL_FILE.put_line (v_fh, '<ss:Styles>');
          UTL_FILE.put_line (v_fh, '<ss:Style ss:ID="OracleDate">');
          UTL_FILE.put_line
                           (v_fh,
                            '<ss:NumberFormat ss:Format="dd/mm/yyyy\ hh:mm:ss"/>'
          UTL_FILE.put_line (v_fh, '</ss:Style>');
          UTL_FILE.put_line (v_fh, '</ss:Styles>');
       END;
    BEGIN
       v_fh := UTL_FILE.fopen (v_dir, v_file, 'w', 32767);
       start_workbook;
       set_date_style;
       start_worksheet ('OM');
       run_query ('select PARTY_ID,PARTY_NAME from HZ_PARTIES
        where PARTY_ID<1080');
       end_worksheet;
       start_worksheet ('PO');
       run_query ('SELECT AGENT_ID,TYPE_LOOKUP_CODE FROM PO_HEADERS_ALL
            WHERE PO_HEADER_ID<20');
       end_worksheet;
       end_workbook;
       UTL_FILE.fclose (v_fh);
    END;
    Here i will get two outputs in same excel with different spread sheets,
    now i want to set background color for headers i
    ex:PARTY_ID,PARTY_NAME,AGENT_ID,TYPE_LOOKUP_CODE are the headers,in excel output i want background color as blue.
    Please do need full help,its urgent req.

    Hello,
    open the file in Excel and save it, just to ensure that Excel writes all the additional stuff it thinks is necessary.
    Now change the background colour of the header and save the file again but with a different name.
    Open both files in a text editor and look at the differences. That's what you need to change in your code.
    Alternatively you can use packages like xml_spreadsheet or ExcelDocumentType, both write the same file format that you use in your code and you don't have to reinvent the wheel.
    Regards
    Marcus

  • Hw do i set background color for ComboBox?

    If anyone knows how to set background color for disabeld (setEnabled(false)) of ComboBox in Windows Look and Feel. It will help me a lot.
    I don't know hoe to do it
    regards
    arun.

    At the start of your program add:
    UIManager.put("ComboBox.disabledBackground", Color.green);
    UIManager.put("ComboBox.disabledForeground", Color.blue);For a list of all the properties you can change with the UIManager see:
    http://www.discoverteenergy.com/files/ShowUIDefaults.java

Maybe you are looking for

  • Front panel of my Audigy 2 won't w

    My front panel on my Audigy 2 won't work. I recently had to replace my motherboard and it won't work since then. It worked fine before. The mixer panel won't even give me the option of Line 2 and Auxilliary in, and my headphone jack won't work either

  • How to sync mail on multiple devices?

    I have a mac and an ipod touch 4gen and i have connected my email account on mail on both devices. I was wondering how to make it that if i opened one email on my ipod it would also be marked as read on mac. Im looking for some way to connect the mai

  • Error while calling BI Publisher 11g webservice.URGENT

    I am trying to schedule existing report and pass parameter using web service API. This is soap envelope I am passing in the web service call: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <pub:scheduleRep

  • IPhoto09 unable to open some jpgs

    After spending two hours with a Mac Genius, who was unable to help me, I'm hoping someone here can. I recently upgraded to iLife09. I started having problems opening up some pictures in iPhoto. Here are the issues: 1) I can see the thumbnail, but whe

  • Having trouble with forms

    Forms are working as far as calling the thank you page, but the content from the form is not being emailed to the recipient. Can anyone tell me what to do please. Here's a link: http://www.multi-craft.com/contact_us/contact_us.html THANKS!