How do you set a parameter value in a jnlp file?

I am trying to figure out how to assign a value to a parameter within a jnlp file and then call that into the main class file. My main class file is below. I want to set firstName inside of the JNLP config file, but am convinced it is impossible. Any thoughts?
public class Greeting
private String firstName;
public Greeting()
public String getName ()
if( firstName == null)
firstName = "Day";
return firstName;
}//end method
public static void main (String args[])
Greeting greeting1 = new Greeting ();
greeting1.getName();
System.out.printf("%s\n", greeting1.getName());
}

In the jnlp file, add the Name as a runtime argument for running the Greeting class from its main(). Then add a constructor like
public Greeting(string name){
firstName = name;
}and then change the Greeting greeting1 = new Greeting ();to Greeting greeting1 = new Greeting (args[0]);A side note, most people on here get all bent out of shape if you don't put your code in the Code formatter on here, in case you didn't know about it before. It's just easier to read.

Similar Messages

  • In printing from download how do you set your printer to print a pdf file without having to save it

    i am using a HP OFFICEJET4500 G510g printer. i am usinmg a program that i am allowled to retrive prepareed documents that are pdf formated. my question is how to set my printer to print these pdf formatted document without having to save the document first

    Hi there alpo64,
    Could you provide the community with a little more information to help narrow troubleshooting? What operating system and browser are we using?
    You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too.

  • How to set UTL_FILE parameter in the INIT.ORA file

    Dear all,
    How can i set UTL_FILE parameter in the INIT.ORA file.
    Also let me know how to create a directory over there.I am new to this area.
    Where exactly i can locate these details and create directory.
    Regards,
    Bala.

    post this in database forum

  • (Administration - Marketing - Import), you can set a parameter value "Import mode" for what to do in case of duplication as "update existing records", "Import new records". The final report of this import is presented as a text file that can be viewed in

    Administration - Marketing -> Import, you can set a parameter value "Import mode" for what to do in case of duplication as "update existing records", "Import new records". The final report of this import is presented as a text file that can be viewed in Business Administration - Marketing -> Import -> Exceptions. Whatever the exception, including duplication import occurs during import and recorded in a text file.   What are the fields that determine the duplicity? How I can I can change those?

    You will be returned anything that is in the option's value parameter. What is displayed in the dropdown and what is put in the value attribute do NOT need to be the same, so maybe you should start there.

  • How do I set a NULL value for the parameter field

    Hi
    I've another question. I'm going to set single values for parameter fields.
    // e.g. set today for StartDate parameter field
    fc.setCurrentValue("", "StartDate", new Date());
    It should be possible to set a NULL value for date parameter fields.
    fc.setCurrentValue("", "StartDate", (Date)null);
    But this do not work. How do I set a NULL value correctly?
    Thank you in advance.
    Best regards,
    Thomas

    First question - is it a stored procedure parameter?
    You can't set a regular parameter field value to a null value.
    There was an issue with old version of the JRC, where it was allowing null to go through, but had unexpected behavior at times.
    Sincerely,
    Ted Ueda

  • Invalid pointer error on setting reportviewer parameter values

    Post Author: erika
    CA Forum: General
    Hi
    I'm using the crystal reports version bundled with VS2005, everything on the web reportviewer works perfectly until I set any parameter values. I then get the following error:
    Message: "Invalid Pointer",
    Source: rptcontrollers.dll,
    Stack Trace:     at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.GetPage(PageRequestContext pPageRequestContext)\r\n   at CrystalDecisions.ReportSource.EromReportSourceBase.GetPage(PageRequestContext pageReqContext)\r\n   at CrystalDecisions.CrystalReports.Engine.FormatEngine.GetPage(PageRequestContext reqContext)\r\n   at CrystalDecisions.ReportSource.LocalReportSourceBase.GetPage(PageRequestContext pageReqContext)\r\n   at CrystalDecisions.Web.ReportAgent.GetPage(Boolean bSeparatePages)\r\n   at CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e)
    My rptcontroller DLL version is: 10.2.0.1093
    The following code is how I set the parameters:
    ParameterFields pfsReport = new ParameterFields();
    ParameterDiscreteValue pdvReport = new ParameterDiscreteValue();
    pdvReport.Value = oReportParameterValues.ToString();
    ParameterField pfdReport = new ParameterField();
    pfdReport.CurrentValues.Add(pdvReport);
    pfsReport.Add(pfdReport);
    rpvView.ParameterFieldInfo = pfsReport; //rpvView = ReportViewer
    rpvView.ReportSource = rptReport; //rptReport = ReportDocument
    rpvView.RefreshReport();
    Has anybody got any answers to how I can fix this, or maybe another way to add the parameter values that doesn't give the same error?

    This is likely an issue with order of operations.  I would try setting the dataset first, then pass parameters.  if that is what you are already doing, reverse the order and see what happens.

  • How do you set NLS_LANG environment variable in report builder

    How do you set up the reports builder environment to display foreign fonts.
    So far what I read makes me think that in report builder I have to set the NLS_LANG environment variable .
    If anyone has done this is that true and if so how.
    Also the languages I want to use are the following.
    Armenian
    Cambodian
    Chinese
    Russian
    Tagalog
    Vietnamese
    How do I find the NLS_LANG environment variables for these.
    Where I am at now+
    I have to set the DEVELOPER NLS LANG. I see the NLS LANG in the registry and I guess I have to add the DEVELOPER NLS LANG.
    Now I am searching for syntax. If anyone knows the syntax for those languages please let me know and how do I set more than 1 at a time.
    Howard
    Edited by: csphard on Apr 14, 2010 5:17 PM
    Edited by: csphard on Apr 14, 2010 5:22 PM
    Edited by: csphard on Apr 15, 2010 9:02 AM

    Hello Howard,
    Check out the following link here you can find your desired NLS parameters.
    http://www.oracle.com/technology/tech/globalization/htdocs/nls_lang%20faq.htm
    And about the NLS_LANG for developer why you want to create for developer. Its is already there in REGISTRY. Just seaching in developer registry you can find there.
    how do I set more than 1 at a time.
    You can set only one NLS_LANG parameter at a time.
    -Ammad
    Edited by: Ammad Ahmed on Apr 15, 2010 8:52 PM

  • How do I set ical default values in lion?

    I have just upgraded to Lion and so far, so good.  In the new iCal, how do I set the default values?  In the old version, when you clicked on the calendar, the default value was a 1 hour meeting around the current time of day.  The new version defaults to an all-day meeting.  I like the old way better, or best would be to have it as a preference. 
    Is there a way to set this that I'm not seeing?

    Mike,
    It sounds to me like you are using the "Month" view for that entry.
    Default event creation in Month view results in an all day event.
    Lion iCal Help (Add events to a calendar) says: "Add a new event in Month view by double-clicking within the day you want the event to appear. Enter a name and time duration for the event in the event’s title field, and then press Return."
    Try entering "Meeting at 9am"...that will create a one hour event named Meeting.

  • How Can I Set a Javascript Value into an Attribute of BSP PAGE

    Hi
    Can anyone tell me.
    How Can I Set a Javascript Value into an Attribute of BSP PAGE

    Hi Mithlesh,
    javascript runs on client side and you cannot assign the value to a Page attribute directly.
    As a workaround,you can use an Inputfield,hidden if required,and set the value using javascript.Then the form will have to be submit to be able to read the value in onInputProcessing and then can be assigned to any variable.
    In Layout
    <head>
    <script language="javascript">
    function pass()
       txt1 = document.getElementById("ip_mrf");
       txt.value = "hello" ;
    </script>
    </head>
    <htmlb:inputField  id="ip_mrf"
                               value="<%=mrf_number%>"
                               visible="FALSE"/>
    in onInputProcessing
    cha1 = request->get_form_field( 'ip_mrf' ).
    where cha1 is the page attribute
    hope this helps,
    Regards,
    Siddhartha
    Message was edited by: Siddhartha Jain

  • How do you set the font color for a specific entire row inside a JTable?

    How do you set the font color for a specific entire row inside a JTable?
    I want to change the font color for only a couple of rows inside a JTable.
    I've seen some ways to possibly do this with an individual cell.
    Clarification on changing the font color in an individual cell would be helpful too if
    there is no easy way to do this for a row.

    hai,
    Try out with this piece of code.Create your table and assign the renderer to each column in the table.
    CellColorRenderer m_CellColorRenderer = new CellColorRenderer();
    for(int i=0;i<your_JTable.getColumnCount();i++)
    your_JTable.getColumnModel().getColumn(i).setCellRenderer(m_CellColorRenderer);
    class CellColorRenderer extends JLabel implements TableCellRenderer
    CellColorRenderer()     
    setOpaque(true);     
    setHorizontalAlignment(LEFT);
    setVerticalAlignment(CENTER);
    setBackground(Color.white);
    setForeground(Color.black);
    protected void setValue(Object value)
         setText((value == null) ? "" : value.toString());
    public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected, boolean hasFocus, int row,int column)
         if(isSelected == true)
              setForeground(Color.red);
         else
              setForeground(Color.black);
         setValue(value);
         return this;
    regards,
    bala

  • How do you set the number of rows in a spreadsheet, so that even when you drag data in, in writes over those rows instead of adding a new row?

    How do you set the number of rows you want in a spreadsheet, so that even when you drag data in, in writes over those rows instead of adding a new row?

    After the discovery reported above, I filed this report :
    Bug ID# 10073038
    Summary:
    When Numbers is used on a system with decimal comma a csv file may be good AND wrong
    Steps to Reproduce:
    With Numbers v2, you introduced an interesting enhancement.
    In system using the comma as decimal separator, Numbers requires csv files using the semi-colon as values delimiter.
    In fact it’s true if we OPEN the document dragging its icon on Numbers one or thru the open dialog.
    This said.
    (1) Drag and drop a csv built with the 'semi-colon' standard on a table or on a sheet
    (2) Drag and drop a csv built with the 'comma' standard on a table or on a sheet
    Expected Results:
    Every normally constituted user assume that in
    case (1) he will get a perfectly built table
    case (2) he will get every cells of a row in a single cell
    Actual Results:
    In fact you forgot the drag and drop way of use and in
    case (1) every values separated by semi-colon are inserted in a single cell
    case (2) values separated by comma are correctly spread in a table
    isn’t it ridiculous ?
    Regression:
    Except looking in  QuickView to see which is exactly the structure of the file to decide the way we will insert it in a Numbers document, we may use an applescript fair enough to replace the semi-colons by TAB characters
    or
    to replace the commas by TABs and the decimal periods by commas
    Notes:
    While I am on this subject, I wish to make two proposals:
    (1)  It would be fine to format the date according to the ISO format year-mm-dd when you export a Numbers doc to csv.
    Doing that, dates would be imported correctly in every countries.
    At this time, on an English system, you export as mm/dd/year.
    If the doc is open on a system using the format dd/mm/year, the results will be odd.
    On a system using the format dd/mm/year, you export this way and so, if the doc is open on a system using the format mm/dd/year the results are odd too.
    As every localized versions accept the ISO format (at least on entry), using it in the export scheme would give a correct behavior everywhere.
    (2) It would be fine to add the format Tab Separated Values in the Export pane.
    TSV + ISO date format would give documents opening flawlessly everywhere.
    Yvan KOENIG (VALLAURIS, France) dimanche 4 septembre 2011 21:27:41
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • Allow only one set of parameter values for all worksheets

    I would like to " Allow only one set of parameter values for all worksheets ", but prompt before executing the worksheet. This function is a great time saver, but the users on occasion would like to change at the least one of the parameters. Is this possible? What setting do I use? I've tried various combinations of the " After opening a workbook: " on the options page. " Run query automatically", " Don't run query (leave sheet empty) ", and " Ask for comformation ". I would have thought that "Ask for comformation " was the trick, but no. I'm considering putting a do nothing parameter that has the setting of " Allow different parameter values for each worksheet. " so that it will keep all the others, default this one, but prompt for a possible change.
    Any thoughts...
    Thanks,
    Jamie

    Hi Jamie
    Even though you have the same parameter for all worksheets a user can still choose what to use on a worksheet. Its just that if they click to another worksheet then that parameter will be applied.
    Which version of Discoverer are you using?
    Best wishes
    Michael

  • How do you tell the color value of a pixel in an image data

    Hi,
    Given a BufferedImage of type, say BufferedImage.TYPE_4BYTE_ABGR, how do you tell the color value of a pixel in the image?
    Specifically, in the following code:
    Raster imgData = image.getData();
    int x = imgData.getMinX();
    int y = imgData.getMinY();
    int width = imgData.getWidth();
    int height = imgData.getHeight();
    I want to search the raster looking for a specific color, e.g., Color.WHITE.
    According to the API, "getSample()" may be used for this purpose. But, how do you know which color band a band index parameter in getSample() refers to? Does band index of 0 always refer to the RED band? Does band index of 1 refer to the GREEN band? etc.
    I'd greatly appreciate any help you may be able to provide.
    Thanks,
    --HS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    In the print dialog underneath the settings for number of copies and print range you should see a dropdown menu probably called Layout. If you don't see that look for a button labeled Details and click it.
    Under the Layout menu you should find an option labeled Printer where you will find Printer specific options. Look for something there. You might also find an option called Color which may have options you are looking for.
    If this doesn't help, go to the printer manufacturer's website and look for answers there.

  • How do you set the answer result row limit?

    I only can see 65000 records even though it should return more values. How do you set it to show all/more the records?
    Thanks.
    Jay

    Try setting
    <ResultRowLimit>120000</ResultRowLimit>
    in the Instanceconfig.xml
    Rgds
    Ed

  • How do you set _first_spare_parameter

    I have seen a number of threads that mention that firstspare_parameter must be set correctly for Streams to operate efficiently. How do you set this? I have not been able to find it in the documentation.
    Thanks

    alter system set "_first_spare_parameter" = 50; no doco hence the _ hidden parameter. but mentioned in oracles 9i streams recommended configuration on metalink. It uses a percentage of the sharedpool for streams.
    can set dynamically but can only increase it. if you want to shrink it must restart.
    I think it is only available from the later releases of 9i, not sure which but maybe 9.2.0.4 and above, you can check that. Not needed in 10g as you have a streamspool.
    I am not sure either whether you need to set compatibility to a higher version than 9.2.0.0.0 for it to work, if anyone knows that can they post.
    i have it set on 9.2.0.6 and compatibility is 9.2.0.0.0 but i am not 100% if it is using the parameter. I have it set to 50 but have had ORA-04031 problems that is why i am not certain it works 100% as during large transaction i run out of memory and it affects operations not related to streams such as a normal PL/SQL commands as there is not a large enough chunk of memory for uses to use...(i thought it if i streams reached 50% of sharedpool it would crash, i would not expect it to affect the other half of the sharedpool)

Maybe you are looking for

  • Good book  on multithreading

    Could any one please give me suggestion on good book on multi threading with good theory. I have basic idea on Multithreading, so i would like to improve myseld on the same. Its better to give the name of the book and what the special in them., I wou

  • No entry in table T001P for key when running time evaluation

    Hi There, All the master data is in synch and I am getting this error when running time evaluation. *No entry in table T001P for key Person rejected: xxxxxxxx* Apparantly this seems to be config error but we have lot of EEs like this, working okay. A

  • JCA Binding Component connection issue - Help plz

    All, soa - 11.1.1.3 I configured a async BPEL which reads data from DB (using DBAdapter) and write to a file. I'm getting the following error frequently. But same BPEL if I test it after few minutes it works, its very intermittent. Any clue? I checke

  • Software update for Asha 501

    When new update of asha is going 2 be launched in india ???? Plz reply Moderator's note: The subject was edited as we provide a topic touched on the subject. Solved! Go to Solution.

  • I can't see the user-defined fields I'm supposed to - where are they?

    Following a recent CACI release upgrade users are expecting to see several user-defined fields within student details in the Enrolments Universe but we can't. Following upgrades, do I need to refresh or run something that'll encorporate any new addit