Formatting java code in html [code]

Hi ppl,
any suggestions how does code tag(formatted java code) works in this site?
thanks in advance.

thanks for looking at my post.
Sorry the question was not too explanatory. I am trying to have same functionality on my jsp page so that i can put formatted java code on jsp page.
So what I am after is any hints or links, for how to achieve this.

Similar Messages

  • Format Java Code with jdeveloper

    Hi Everybody,
    Can anybody tell me How I can Indent Java Code Automatically using JDeveloper 9i.
    It is a facility which is provided in almost all the editor and I believe it should be in jdeveloper also but the problem is I dont know how to go for it.
    I will be very kind to anybody who will solve this problem as this will reduce my lot of unwanted work.
    Regards,
    Amit Jain

    If you're looking for a code beautifier (a tool that can apply a coding style to your source code automatically), try the Jalopy extension. It's an open source code beautifier that is tightly integrated with JDeveloper:
    http://jalopy.sourceforge.net/plugin-jdev.html
    Thanks,
    Brian
    JDev Team

  • Color names in Java code format.  Looking for the 216 safe colors.

    Color names and associated values are available in HTML format; I am looking for such a list in Java code.
    thanks for any help.

    // Since I could not find it, I pasted it up myself.
    // Since I think it is useful and cool, I am sharing it.
    import java.awt.Color;
    Java class of the standard non-standard "safe" browser colors.
    View and choose colors grouped by color at
    <http://halflife.ukrpack.net/csfiles/help/colors.shtml>
    or others.
    Colors in this alpha ordered list are presumed to correspond.
    public class Colors {
    public static final Color AliceBlue = rgb("F0F8FF");
    public static final Color AntiqueWhite = rgb("FAEBD7");
    public static final Color Aqua = rgb("00FFFF");
    public static final Color Aquamarine = rgb("7FFFD4");
    public static final Color Azure = rgb("F0FFFF");
    public static final Color Beige = rgb("F5F5DC");
    public static final Color Bisque = rgb("FFE4C4");
    public static final Color Black = rgb("000000");
    public static final Color BlanchedAlmond = rgb("FFEBCD");
    public static final Color Blue = rgb("0000FF");
    public static final Color BlueViolet = rgb("8A2BE2");
    public static final Color Brown = rgb("A52A2A");
    public static final Color BurlyWood = rgb("DEB887");
    public static final Color CadetBlue = rgb("5F9EA0");
    public static final Color Chartreuse = rgb("7FFF00");
    public static final Color Chocolate = rgb("D2691E");
    public static final Color Coral = rgb("FF7F50");
    public static final Color CornflowerBlue = rgb("6495ED");
    public static final Color Cornsilk = rgb("FFF8DC");
    public static final Color Crimson = rgb("DC143C");
    public static final Color Cyan = rgb("00FFFF");
    public static final Color DarkBlue = rgb("00008B");
    public static final Color DarkCyan = rgb("008B8B");
    public static final Color DarkGoldenRod = rgb("B8860B");
    public static final Color DarkGray = rgb("A9A9A9");
    public static final Color DarkGreen = rgb("006400");
    public static final Color DarkKhaki = rgb("BDB76B");
    public static final Color DarkMagenta = rgb("8B008B");
    public static final Color DarkOliveGreen = rgb("556B2F");
    public static final Color Darkorange = rgb("FF8C00");
    public static final Color DarkOrchid = rgb("9932CC");
    public static final Color DarkRed = rgb("8B0000");
    public static final Color DarkSalmon = rgb("E9967A");
    public static final Color DarkSeaGreen = rgb("8FBC8F");
    public static final Color DarkSlateBlue = rgb("483D8B");
    public static final Color DarkSlateGray = rgb("2F4F4F");
    public static final Color DarkTurquoise = rgb("00CED1");
    public static final Color DarkViolet = rgb("9400D3");
    public static final Color DeepPink = rgb("FF1493");
    public static final Color DeepSkyBlue = rgb("00BFFF");
    public static final Color DimGray = rgb("696969");
    public static final Color DodgerBlue = rgb("1E90FF");
    public static final Color Feldspar = rgb("D19275");
    public static final Color FireBrick = rgb("B22222");
    public static final Color FloralWhite = rgb("FFFAF0");
    public static final Color ForestGreen = rgb("228B22");
    public static final Color Fuchsia = rgb("FF00FF");
    public static final Color Gainsboro = rgb("DCDCDC");
    public static final Color GhostWhite = rgb("F8F8FF");
    public static final Color Gold = rgb("FFD700");
    public static final Color GoldenRod = rgb("DAA520");
    public static final Color Gray = rgb("808080");
    public static final Color Green = rgb("008000");
    public static final Color GreenYellow = rgb("ADFF2F");
    public static final Color HoneyDew = rgb("F0FFF0");
    public static final Color HotPink = rgb("FF69B4");
    public static final Color IndianRed = rgb("CD5C5C");
    public static final Color Indigo = rgb("4B0082");
    public static final Color Ivory = rgb("FFFFF0");
    public static final Color Khaki = rgb("F0E68C");
    public static final Color Lavender = rgb("E6E6FA");
    public static final Color LavenderBlush = rgb("FFF0F5");
    public static final Color LawnGreen = rgb("7CFC00");
    public static final Color LemonChiffon = rgb("FFFACD");
    public static final Color LightBlue = rgb("ADD8E6");
    public static final Color LightCoral = rgb("F08080");
    public static final Color LightCyan = rgb("E0FFFF");
    public static final Color LightGoldenRodYellow = rgb("FAFAD2");
    public static final Color LightGrey = rgb("D3D3D3");
    public static final Color LightGreen = rgb("90EE90");
    public static final Color LightPink = rgb("FFB6C1");
    public static final Color LightSalmon = rgb("FFA07A");
    public static final Color LightSeaGreen = rgb("20B2AA");
    public static final Color LightSkyBlue = rgb("87CEFA");
    public static final Color LightSlateBlue = rgb("8470FF");
    public static final Color LightSlateGray = rgb("778899");
    public static final Color LightSteelBlue = rgb("B0C4DE");
    public static final Color LightYellow = rgb("FFFFE0");
    public static final Color Lime = rgb("00FF00");
    public static final Color LimeGreen = rgb("32CD32");
    public static final Color Linen = rgb("FAF0E6");
    public static final Color Magenta = rgb("FF00FF");
    public static final Color Maroon = rgb("800000");
    public static final Color MediumAquaMarine = rgb("66CDAA");
    public static final Color MediumBlue = rgb("0000CD");
    public static final Color MediumOrchid = rgb("BA55D3");
    public static final Color MediumPurple = rgb("9370D8");
    public static final Color MediumSeaGree = rgb("3CB371");
    public static final Color MediumSlateBlue = rgb("7B68EE");
    public static final Color MediumSpringGreen = rgb("00FA9A");
    public static final Color MediumTurquoise = rgb("48D1CC");
    public static final Color MediumVioletRed = rgb("C71585");
    public static final Color MidnightBlue = rgb("191970");
    public static final Color MintCream = rgb("F5FFFA");
    public static final Color MistyRose = rgb("FFE4E1");
    public static final Color Moccasin = rgb("FFE4B5");
    public static final Color NavajoWhite = rgb("FFDEAD");
    public static final Color Navy = rgb("000080");
    public static final Color OldLace = rgb("FDF5E6");
    public static final Color Olive = rgb("808000");
    public static final Color OliveDrab = rgb("6B8E23");
    public static final Color Orange = rgb("FFA500");
    public static final Color OrangeRed = rgb("FF4500");
    public static final Color Orchid = rgb("DA70D6");
    public static final Color PaleGoldenRod = rgb("EEE8AA");
    public static final Color PaleGreen = rgb("98FB98");
    public static final Color PaleTurquoise = rgb("AFEEEE");
    public static final Color PaleVioletRed = rgb("D87093");
    public static final Color PapayaWhip = rgb("FFEFD5");
    public static final Color PeachPuff = rgb("FFDAB9");
    public static final Color Peru = rgb("CD853F");
    public static final Color Pink = rgb("FFC0CB");
    public static final Color Plum = rgb("DDA0DD");
    public static final Color PowderBlue = rgb("B0E0E6");
    public static final Color Purple = rgb("800080");
    public static final Color Red = rgb("FF0000");
    public static final Color RosyBrown = rgb("BC8F8F");
    public static final Color RoyalBlue = rgb("4169E1");
    public static final Color SaddleBrown = rgb("8B4513");
    public static final Color Salmon = rgb("FA8072");
    public static final Color SandyBrown = rgb("F4A460");
    public static final Color SeaGreen = rgb("2E8B57");
    public static final Color SeaShell = rgb("FFF5EE");
    public static final Color Sienna = rgb("A0522D");
    public static final Color Silver = rgb("C0C0C0");
    public static final Color SkyBlue = rgb("87CEEB");
    public static final Color SlateBlue = rgb("6A5ACD");
    public static final Color SlateGray = rgb("708090");
    public static final Color Snow = rgb("FFFAFA");
    public static final Color SpringGreen = rgb("00FF7F");
    public static final Color SteelBlue = rgb("4682B4");
    public static final Color Tan = rgb("D2B48C");
    public static final Color Teal = rgb("008080");
    public static final Color Thistle = rgb("D8BFD8");
    public static final Color Tomato = rgb("FF6347");
    public static final Color Turquoise = rgb("40E0D0");
    public static final Color Violet = rgb("EE82EE");
    public static final Color VioletRed = rgb("D02090");
    public static final Color Wheat = rgb("F5DEB3");
    public static final Color White = rgb("FFFFFF");
    public static final Color WhiteSmoke = rgb("F5F5F5");
    public static final Color Yellow = rgb("FFFF00");
    public static final Color YellowGreen = rgb("9ACD32");
    public Colors() {  }
    private static Color rgb(String hexValue){
    return(new Color(
    Integer.parseInt(hexValue.substring(0, 2), 16),
    Integer.parseInt(hexValue.substring(2, 4), 16),
    Integer.parseInt(hexValue.substring(4), 16)));

  • How to insert html table inside java code

    Hi,
    I want to send an email with data in table format(with rows and columns) .Please tell me how to achieve this in java code .I just want to know the code for making the table in java
    Please help me
    Thanks in advance

    NewUser7 wrote:
    Please tell me how to generate html tables in java. .. Do you know how to produce an HTML table in HTML?
    ..i dont have jspI did not mention JSP. Pure J2SE code can produce HTML, though if done in a web-app., it would generally be done using JSP or Servlets.
    Here is an example of producing HTML in J2SE.
    import javax.swing.*;
    class HtmlTable {
         public static void main(String[] args) {
              int[][] values = {
                   {1,3894,5387},
                   {2,4112,4459},
                   {3,4886,6076}
              String prefix = "<html><body><table>\n";
              final StringBuilder sb = new StringBuilder(prefix);
              sb.append("<tr>");
              sb.append("<th>");
              sb.append("Month");
              sb.append("</th>");
              sb.append("<th>");
              sb.append("Unit A<br>Sales");
              sb.append("</th>");
              sb.append("<th>");
              sb.append("Unit B<br>Sales");
              sb.append("</th>");
              sb.append("</tr>\n");
              for (int ii=0; ii<values.length; ii++) {
                   sb.append("<tr>");
                   for (int jj=0; jj<values[ii].length; jj++) {
                        sb.append("<td>");
                        sb.append("" + values[ii][jj]);
                        sb.append("</td>");
                   sb.append("</tr>\n");
              sb.append("</table>");
              sb.append("</body>");
              sb.append("</html>");
              Runnable r = new Runnable() {
                   public void run() {
                        JOptionPane.showMessageDialog(
                             null,
                             new JTextArea(sb.toString(),20,10) );
                        JOptionPane.showMessageDialog(
                             null,
                             new JLabel(sb.toString()) );
              SwingUtilities.invokeLater(r);
    As an aside, those terms are HTML (an abbreviation) Java (a proper name) & JSP (an abbreviation). Please try to use correct upper/lower case when using technical terms.

  • Java code to convert XML file to ISO XML format

    Hi Experts,
    I need to convert an XML file to ISO Xml format using Java code.I dont have any idea about the ISO XML format.I searched but what i am getting is ISO is an encoding in XML.
    It will be very helpful if any one can give me a sample ISO XML file, and any way around to carry out the required conversion.
    Thanks .
    Anika

    Hi,
    For ISO encoding you need the XML file to be converted with below providing the encoding paramter as ISO. for e.g.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    instead of
    <?xml version="1.0" encoding="UTF-8"?>
    this can be possible with using XML encoders.
    Refer XML encoding--> http://www.w3schools.com/XML/xml_encoding.asp
    Refer Java Code with uasage of XMLEncoder
    http://java.sun.com/j2se/1.4.2/docs/api/java/beans/XMLEncoder.html
    Thanks
    Swarup

  • Text formatted like Java code

    I was going to put some examples of java code on a website that I'm currently building, what is the easiest way to format the HTML to look like some of the code examples used in these forums? Could I do it with a stylesheet or XML or would I have to do something really complicated?

    Just use normal html: heres a template:-
    <html>
    <title>* Your title *</title><head><h4>AProgram.java</h4><hr></head
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <body bgcolor='white'>
    <table border=0 cellPadding=2 cellSpacing=0 width="100%">
    <TR><td width="8%"></td>
    <td width=80%></td><td></td></tr>
    <tr></td><td><td><font face='Courier' size='3' color='black'>
    public class AProgram {
    </body>
    </head>
    Don't use the <pre> tag as cuases the text to be unusually spaced or to come out tiny for those using resolutions above 800 x 600 and you'll need to hand code certain things eg;-
         space = & nbsp ; // close the spaces
         left tag '<' = & lt ; // close the spaces
         right tag '>' = & gt ; // close the spaces

  • How i can use ExportPDF in java code to get html files as PDF?

    I need to use ExportPDF in java code to export my html to PDF and save that in my local system.

    Yes, it's not a service for automating. Automating Acrobat is a possibility (though awkward), or there are server products.

  • Read values on HTML page(flash embedded) using Java code

    Hi,
    we can normally parse a HTML and can get values on a web page using java code.
    is the same possible with HTML page indluding flash?
    my basic need is to read values on webpage displayed by flash
    thanks
    R

    flash can communicate with javascript using the externalinterface class.

  • Rendering HTML JSF Component via java code

    Hey,
    I was wondering,
    I want to build sort of HTML generator (for a very specific process),
    I thought about taking the advantage of JSF components instead of writing an HTML generator,
    Is it possible to render Html JSF Components via simple java class?
    For instance, assuming I built an 'HtmlDataTable' object with columns, inputs, etc...
    I'd like to render the dataTable as HTML and get the HTML tags via a simple java class,
    Thanks.

    the sample JAVA codes are provided for sending SPML requests, HTTPClient and one more (i dont remember rite now) within the OIM installation folders itself. It's in the 'SampleHttpClient' folder. Check it once. WSDL, sample XML's and the JAVA codes all are there. You just need to set the classpath and run it.
    - oidm.

  • How to click a HTML page button from Java code?

    Know the HTML page name and the button id in this page, how to click the button automaticly in java code(Like in awt or swing)?

    ukkus wrote:
    Hi,
    Thank for the quick reply,
    It will be very helpful if you can tell me how can we do this, I am not able to get how to do the same, with the link that you have provided.You haven't even had time to read it yet.
    >
    Actually main scenario is:
    I have to RUN a JSP report which will call this script. That JSP report and script is in UNIX server. Can you please explain how to perform this task.Running this from a JSP is an even worse programming practice than running it from a standalone application.

  • Sample Java  Code to send an HTML mail with embeded image

    Hello,
    Please can I get a sample Java code on sending an HTML mail with embeded image.
    The HTML message and relevant input parameters withhbe supplied from a PL/SQL that will call the class , the class will embed the image and send the mail to the recepient.

    tev wrote:
    Please can I get a sample Java codeNo. This is a forum, not a code mill.
    Recommended reading: How to ask questions the smart way
    db

  • Fill a pdf form with data using Java code

    Hi,
    Modern formats of Acrobat ".pdf" files allows to define form fields.
    I have a datasource, let's say in a database.
    I want to fill my ".pdf" with my database-stored data automatically, and want to write Java code for that.
    1. What is the best way to achieve this ?
    2. Is it necessary to install Acrobat Distiller server and if so what web services should I invoke ? Where is the doc ?
    3. Are there efficient Java libraries to do so ?
    Thank you for helping... As ever, this is kind of an emergency case
    Have a good day.
    Phil

    Take a look at the FDF Toolkit for Java:
    http://www.adobe.com/devnet/acrobat/fdftoolkit.html
    That will allow you to, through Java, construct an FDF that contains all your form data.  You then add a reference to your "template" PDF file in the FDF as well and send the FDF to the client.  Acrobat will open the FDF, see the reference to the PDF, open the PDF and then merge any data contained in the FDF with the PDF.

  • Compiling Java code with Japanese characters

    I have a Java code with some Japanese characters. My compiler doesn't recognise these characters and gives me error messages.
    Please help me.

    Obviously it's not the copmiler's fault. You need to fix your code.
    Here is a link to the Java Language Specification.
    The link is to section 3.8 - Identifiers.
    It describes the acceptable naming:
    http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#40625
    Perhaps your editor is not saving the text file in an appropriate format.
    What editor are you using?
    Try vim http://www.vim.org
    or SciTE http://www.scintilla.org/SciTE.html

  • JDev 10.1.3 - Early Release - JAVA Code Reformatter - Options ?

    Hi All,
    how do I specify formating options for the java source code reformatter ?
    I don't like the way it reformats my code.
    TIA
    Bill

    Tools -> Preferences -> Code Editor -> Code Style -> Edit (Button): change anything to the way you prefer, save it. Now "Reformat" will work the way you desire. This only applies to Java code, and not files containing JSP, HTML, etc. A JDev developer mentioned that they will probably, at least, allow tab/space customization for those types of files in some future version.
    -Chris

  • Printing java code. A good app?

    Hi all. I want to print some java code, and I would like it to have the formatting of these forums with the bold settings. All the applications I've used for editing java are color coded, which is great for coding with, but my printer is black and white. I would like to find an app that formats java similar to this forum when you use the code tags so it will make reading the code on hard copy easier.
    Any suggestions?

    I wrote syntax highlighting code:
    http://ostermiller.org/syntax/
    You could use the application with it that creates syntax highlighted html from the source files:
    http://ostermiller.org/syntax/tohtml.html
    Using that it is very easy to change how the various elements are displayed. you simply change their attributes and colors in a cascading style sheet. You would just have to modify one similar to this one:
    http://ostermiller.org/syntax/syntax.css
    There are some examples of how to make things bold and italic in there already.

Maybe you are looking for

  • Interface design issue

    I like the product overall, however, the choice to use a single panel for all connections and subsequent trees for objects doesn't really work for me. It seems that too many times, I end up having to scroll for a long period of time to find the objec

  • solved pls help needed in creating template

    hi frs i have created a template need some modification to be done my xml output looks like below off            hours              q1           q2          q3         avg aaa          10                    1            2            3            2 bb

  • BBP_PGRP_FIND - Filter PGRP by Ccode

    Hi All, We have a special requirement, where in the standard Purch. group determination to be overridden and determine only the purch. groups assigned to the company code on the shopping cart item. But the BADI BBP_PGRP_FIND does not pass the item li

  • CSS issues with FireFox

    I was wondering if anyone could help, the attached code displays fine in IE6 but the left hand column goes haywire in FF. Any suggestions? Thanks in advance! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1

  • TV Input to a G5 iMac?

    Greetings! I was wondering if there is a way to input cable TV or an RCA signal into a G5 iMac and have it display. Something like an external ATi All In Wonder card, or the ATi TV card, only external. Thanks! bE