Is is possible to give a String color?

Hi,
I know the question sounds silly but what I mean is it possible to play with some code to make
String s = "Hi";
// Some code between...
System.out.println(s);and see the sentence hi in red or bold. (without using System.err kind of trick. Thanks...

Hi,
Someone correct me if this is wrong, but what you are
talking about sounds to me that you are wanting
GUI-ness in your console app. I don't think it can
be done. That's absolutely correct. I want it :))
If you want this, what the heck, create a
GUI app, and if you want and are using the proper
type of textbox, format your output with HTML.I know this is possible, but it takes more time than console programming. I am lazy, so I wanted shortcut if possible :)
Thanks for the help though....

Similar Messages

  • Is it possible to give an added row a Color.

    Hello I read data of a txtfile and than place the data in a jtable.
    I know how to give a selected row an other color but my question is:
    Is it possible to give an added row a Color.
    I make the new row this way
    moddellist.addRow(new Object[]{data,""});
    Now I want this added row red is this possible.
    I don't know what the rowIndex or Cell number is.

    The colour of a cell in a JTable is assigned by a TableCellRenderer. If you look at how that works, all it knows is the object in the cell, the table, the row and column number, and whether the cell is selected or focussed. It doesn't care when things happened.
    So if you want your TableCellRenderer to colour your cells based on something that isn't in that list, then you have to modify the design of your object, the one in the cell, so that it contains information the cell renderer can use to decide what colour to render it.
    Based on your description I can't say much more than that, because it's hardly a complete description of how the colour scheme is supposed to work.
    And by the way the people in the Swing forum are better at answering Swing questions.

  • Is it possible to change the theme color of a view...

    Hi,
    In the bar chart i want to give my own themes(my selected colors) for the bars.how can i do that.i want to give my own theme as a existing one.
    and also is that possible to give multiple themes for a single bar chart,what i mean to say is that i want to apply different themes for individual groups in a single bar chart..
    And one more doubt can i give different colors for a single group in a bar chart.
    Thank You,,,
    KatchSathish
    Thank you...
    KatchSathish
    Message was edited by:
    KatchSathish

    Yes, You can have your own themes and you can change the colour of the existing Theme.
    Connect to BAM->Architect->System->Views->Chart Themes.
    You can edit the colors of the existing Theme or You can create your own theme here.
    Thanks
    Laj

  • Is it possible to set a different color to part of a cell?

    Hi all,
    I am have trouble setting cell-specific Renderer.
    I have followed the instructions in the UISwing tutorial
    and extended JTable definition to overload getCellRenderer()
    to return myRenderer
    final JTable tableView = new JTable(dataModel){
    public TableCellRenderer getCellRenderer(int row, int column) {
    TableCellRenderer colorRenderer = new ColorRenderer();
    return(colorRenderer);
    My class definition for ColorRenderer is as follows:
    class ColorRenderer extends JLabel implements TableCellRenderer {
    public ColorRenderer() {
    public Component getTableCellRendererComponent(
    JTable table, Object color,
    boolean isSelected, boolean hasFocus,
    int row, int column) {
    setForeground(Color.blue);
    return this;
    Is it possible to set a different color to part of a cell?
    eg. I have "TEST,CELL,COLOR" as a string in a cell.
    Can I set a different color to the substring "CELL"?
    Your suggestions will be accepted most gratefully!
    Thanks in advance
    -Kalpana

    You should inherit your table cell renderer from a container, for example JPanel, add different JLabels to the panel and color them separately.
    Kurta

  • Is it possible to receive a String[] back into stored procedure?

    Hi,
    Is it possible to return String [] into plsql procedure?
    I have a class :
    class CreditCard {
    public static String cc (String args []) []
    throws
    SQLException, ClassNotFoundException
    I load it into the database and then create a plsql procedure:
    CREATE OR REPLACE PROCEDURE check_credit(
    card_number IN          VARCHAR2,
    exp_month IN          VARCHAR2,
    exp_year      IN          VARCHAR2,
    flag1      OUT varchar2,
    flag2          OUT varchar2)
    AS LANGUAGE JAVA
    NAME 'CreditCard.cc(java.lang.String[]) return java.lang.String[]';
    trying to compile it gives me:
    20/1 PLS-00311: the declaration of "CreditCard.cc(java.lang.String[])
    return java.lang.String[]" is incomplete or malformed
    Is it possible to receive a String[] back into stored procedure?
    Thanks
    Leonid

    I don't think you can use a String Array directly, you have to use an oracle.sql.ARRAY.
    You use the oracle.sql.ARRAY parameter in Java as an OUT parameter in the stored procedure. You need to use an ArrayDescriptor which requires a corresponding Oracle Nested Table type.
    Try something like the following:
    First the Nested Table Type:
         CREATE OR REPLACE TYPE
         TBL_STRINGS AS TABLE OF VARCHAR2(999);
    Then the Java method:
    public static void getStrings(oracle.sql.ARRAY[] theStrings) //has to be an array of oracle.sql.ARRAY's as we use it as an OUT parameter
    try
         //get a connection
         Connection conn = DriverManager.getConnection("jdbc:default:connection:");
         String [] colours = new String []{"RED", "GREEN", "GOLD"};
    ArrayDescriptor desc = ArrayDescriptor.createDescriptor("TBL_STRINGS", conn);
    theStrings[0] = new oracle.sql.ARRAY(desc, conn, colours);
         conn.close();
    catch (SQLException sqle)
              //report error
    Then the call spec:
         PROCEDURE GET_STRINGS(p_the_strings     OUT     TBL_STRINGS)
         AS LANGUAGE JAVA
         NAME 'mypackage.MyClass.getStrings(oracle.sql.ARRAY[])';

  • Is it possible to pass a string from an applet to the web site?

    Hi, everybody!
    Is it possible to pass a String from an applet to a web site (as a field value in a form, an ASP variable, or anything else). Basically, I have a pretty large String that is being edited by an applet. When a user clicks on the submit button, a different page will show up which has to display the modified string. The String is pretty large so it doesn't fit into the URL variable.
    Please, help!
    Thank you so much!

    Why do you want to do this in Java?
    Javascript is the correct language for these type of situations.
    for instance:
    in the head of your html document:
    <script language=javascript type="text/javascript">
    createWindow(form){
    if(form.text.value!=""){
    newDoc = new document
    newDoc.write(form.text.value)
    newWin = window.open(document,'newWin','width=200;height=150')
    </script>
    in the body:
    <form onSubmit="createWindow(this)">
    <p>
    Enter a String:<input type=text size=30 name="text">
    </p><p>
    <input type=submit value="submit"> 
    <input type=reset value="reset">
    </p>
    </form>

  • How to Update a clob column..it gives error string literal too long

    I am trying to update a clob column of a table but it gives error string literal too long plz tell me what's the issue
    ORA-01704: string literal too long

    Peeyush wrote:
    I am trying to update a clob column of a table but it gives error string literal too long plz tell me what's the issue
    ORA-01704: string literal too longThere's a problem with my car. It won't start. Why won't it start? Please tell me!
    Oh wait, you can't, because I haven't given you nearly enough information...
    In other words, if you would like help in trying to work out where you've gone wrong, you should provide a small enough example of your code that demonstrates the error. We might then actually stand a chance of being able to help you!

  • Possibility to give a pdf a variable when opening?

    Is it possible to give a PDF a variable. The problem is:
    I want to call a pdf with a url from webbrowser. When it opens it should import a xfdf or xml-file. I'm searching for a way to tell the pdf which file to import. I thought about a param in the url but I think it's not possible. Is it possible to put a javascript in an pdf which can read a cookie in which the path to the xml-file is? Is there another way to tell a pdf file in the moment when it is opend which xml file it should import??

    Try the following to capture the URL and then build your logic based on the value.
    var cURL
    cURL = this.baseURL
    xfa.host.messageBox(cURL)
    this is a JavaScript function may used in form:ready event. If you get the value displayed you can save it and use. I have no similar environment to test this myself. Please let me know how that works.
    Good Luck,
    SekharN
    www.lawson.com

  • Is it possible to put two different colors in tree parent node background and child nodes background?

    Is it possible to put two different colors in tree parent
    node background and child nodes background?
    Any help will be very helpful.
    Thanks

    Hi PanosE,
    Yes, you can set up another Standard Edition Server in child domain and then deploy pool pairing.
    You need to deploy a new Front End Pool for the new Standard Edition Server.
    A similar case for your reference.
    https://social.technet.microsoft.com/Forums/office/en-US/eca4299c-8edb-481e-b328-c7deba2a79ba/lync-2013-standard-edition-lync-fe-pools-in-multiple-domain-single-forest-senario?forum=lyncdeploy
    Best regards,
    Eric
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Is it possible to give each page within one pdf document a specific set of print settings?

    I have a complex document (catalogue) that requires printing. There are several different printer settings required and each one is specific to each page within the document. For instance pg 1 is single sided in colour, page 2-3 is duplexed in b&w, page 3-8 is duplexed in colour, etc.... Is it possible to give each page within the pdf document a given set of print settings and then print the entire document as a whole?

    Hi jennyskop
    I assume that is not feasible ...You need to give the print command again and select the respective pages and their settings !

  • Is it possible to add a string inside a textbox with a value of another textbox for Acrobat Forms?

    Is it possible to add a string inside a textbox with a value of another textbox?
    ex.
    Textbox1 = Happy
    Textbox2 = Sad
    Textbox3 = "I am Happy therefore I am not Sad"
    "I am (value of textbox1) therefore I am not ( value of textbox2)"

    Use this code as the custom calculation code of Textbox3:
    event.value = "I am " + getField("textbox1").value + " therefore I am not " + getField("textbox2").value;
    Notice that the field names are case-sensitive.

  • Is it not possible to give the select single field without an into clause

    Hi,
    i have to check whether my input value( only one filed) is available in the table.
    for eg i need to check whether company code is available in the table t001.
    then i will give .
    data lv_bukrs type t001-bukrs.
    lv_bukrs = 1010.
    select single bukrs from t001 where bukrs = lv_bukrs.
    here its asking for me to give a vaible to store the bukrs that is
    select single bukrs into dummyvalue from t001 where bukrs = lv_bukrs.
    Is it not possible to give the select single fieldname without an into clause

    Its Possible by declaring the tables statement
    <b>tables : AFKO.
    select single * from AFKO where <condition>.</b>
    If SINGLE is specified, the resulting set has a single line. If the remaining additions to the SELECT command select more than one line from the database, the first line that is found is entered into the resulting set. The data objects specified after INTO may not be internal tables, and the APPENDING addition may not be used. The addition ORDER BY can also not be used.
    An exclusive lock can be set for this line using the FOR UPDATE addition when a single line is being read with SINGLE. The SELECT command is used in this case only if all primary key fields in logical expressions linked by AND are checked to make sure they are the same in the WHERE condition. Otherwise, the resulting set is empty and sy-subrc is set to 8. If the lock causes a deadlock, an exception occurs. If the FOR UPDATE addition is used, the SELECT command circumvents SAP buffering.
    Notes
    When SINGLE is being specified, the lines to be read should be clearly specified in the WHERE condition, for the sake of efficiency. When the data is read from a database table, the system does this by specifying comparison values for the primary key.
    If accessing tables for which SAP buffering is planned for single records, the SAP buffer is bypassed if the addition SINGLE is not specified. This behavior depends on the current implementation of the database interface and may change in future releases. In particular, it should not be used to bypass the SAP buffer. You should use the explicit addition BYPASSING BUFFER for this instead.
    The addition SINLGE is not permitted in a subquery.
    Regards
    - Gopi

  • Is it possible to give a user read access to an SAP table but to restrict it to a subset of columns?

    Hi,
    is it possible to give a user read access to an SAP table but to restrict it to a subset of columns?
    Thanks,
    Digesh

    Hi Digesh,
    If your requirement is to restrict the excess to specific rows it is possible to use S_TABU_LIN, but it works only for table which contains org units, like plant, company code, etc.
    Please search for S_TABU_LIN if this is your requirement.
    Otherwise please follow Alex's suggestion.
    BR,
    Mangesh

  • Is it possible to pass a string representing a class name in java as an arg

    Hi, this is probably a bit of a stupid question, but one that has me quite confused all the same!
    Is it possible to pass a string or class name etc. representing a type of class in java, to a method so that instead of having to redefine a method with say the following args:
    public SolarPanels[] bestPVPanels(int budget, int percent) {
            HashMap<Integer, SolarPanels> panelsMap    = new HashMap<Integer, SolarPanels>();
    }As at present needing to create a methods bestWindTurbine() and many others exactly the same, but for the type, I would instead like to be able to create a method like:
    public Object[] bestRenewable(int budget, int percent, String aClassName) {
            HashMap<Integer, aClassName > renewableMap    = new HashMap<Integer, aClassName >();
    }But cant sus how to do this as passing a String is off course going to cause problems unless its it possible to cast a string to a class name, any help or advance would be much appreciated.
    Thanks in advance
    Pat Nevin

    pNev wrote:
    But cant sus how to do this as passing a String is off course going to cause problems unless its it possible to cast a string to a class nameIt's not. You can do things like
    Class.forName(classNameInString);But that will only return a Class object.
    And as Java generics are erased at runtime, passing the class name to the method is useless as it is too late to use it anyways.
    Ah, Peter's way is what I was thinking of. Too early in the morning.
    Edited by: Kayaman on 23.6.2010 10:02

  • Is it possible to append a string on canvas without calling repaint() ??

    Hi..experts
    I am new to J2ME programming. i want to append characters on canvas one by one.
    is it possible to append a string to another that is allready drawn without repainting all canvas.
    please help me.
    Thanks a lot

    without repainting all canvas.if your not comfortable repainting the entire canvas, You can use the selective repaint function. it repaints only the area specified by you
    repaint(int x, int y, int width, int height)
    //Requests a repaint for the specified region(x,y) of the Canvas.ps: selective repainting is the VM's decision

Maybe you are looking for

  • Need suggestion on modeling

    Hi i am developing a small software for a very small organisation. I have finished and finalised the database schema design so now into java coding. before i code i want to have proper design. I am very much interested in designing. My basic requirem

  • How to set the notifications structure form a form in IDM 8.0.0.5

    Hi, we are using Identity Manager 8.0.0.5 and we are trying to set the notifications structure which is evaluated in the Create User and Update User workflow from within our Tabbed User Form and from a ActivveSync Form. We had no success in either ca

  • Problem in Exit button on Browser

    Hi, I am using a Command Toolbar button named Exit. By the way, I am using the below code in the "action" block. public String cb1_action2()         // Add event code here...     FacesContext facesContext = FacesContext.getCurrentInstance();     org.

  • Check box before select option in a report program.

    Hi All.. I have a report program with select options..I want to put a checkbox before the select option, aligned with it...Is it possible.. Regards Rudra

  • Conditional Display of Report Columns

    I'm trying to hide a vertical list column, but it is either permanently off or permanently on. Any ideas! For example:- Display Department name if not null