Setting UIManager properties via swing.properties file

Folks'es,
I would like to change some default settings of existing Swing Applications, eg font size. The API doc for UIManager mentions the file swing.properties and three levels of defaults, that are being searched/used.
How can I set up these 3 levels? Where are their settings defined?
Can some kind soul pls enlighten me, as to how to setup swing.properties? The only thing I could get to work was setting the L&F (I got an error message when setting the Windows L&F on Solaris :).
here are some lines I tried, but they don't have any effect:label.font=javax.swing.plaf.FontUIResource[family\=Dialog,name\=Dialog,style\=plain,size\=40]
table.font=javax.swing.plaf.FontUIResource[family\=Dialog,name\=Dialog,style\=plain,size\=20]
table.color=javax.swing.plaf.ColorUIResource[r\=255,g\=0,b\=0]
button.background=javax.swing.plaf.ColorUIResource[r\=255,g\=0,b\=0]they don't make a lot of sense, i know, i just want to get a handle on this.
and yes, i tried upper/lower case, qutoes, etc etc
stuck and desperate after hunting all morning through the forums...
thomas
Message was edited by:
kloeber

to me there is the main question: where does a
Swing L&F gets its default properties from and From the L&F class. Take a look at the source for MetalLookAndFeel. Granted, this is not a very well developed L&F, from a code perspective. There are numerous inconsistencies in how things are used throughout the various UI delegates. (And don't get me started on the subclass-ability of Basic/Metal classes.)
I've recently written my own L&F for a project that started by using Metal as a basis, and had to rip out or rewrite so much, it really shows why few people write L&F's for Swing.
is there a way of overwriting them 'from the outside',
ie can users change them to suit their individual taste.There is nothing that I can see that is any standard mechanism in Swing to support this. I think it comes down to you just have to implement it yourself.
In my recent experiences with working on a L&F, the problems come down to this:
a) The first time you look at the code for Metal/Basic, it's extremely intimidating how much.
b) You think you can subclass a lot, but once you realize you can't without rewriting large chunks and start really looking at the code in detail, you really get intimidated, and a bit mad at Sun.
c) Finally you either give up, or realize you have to pick your battles. For example, coping some classes outright to tweak a couple things.
You really need to take time to understand how it all works (and there's no really good documentation). It's nearly a full time job to work thru a L&F.

Similar Messages

  • Powershell - Bulk Set-ADUser attributes via a CSV file

    I am attempting to do a Bulk replace of AD User account attributes via a CSV file.  Each line in this script works except the part of Set-ADUser where I enter -Replace $attribs. I'm not sure how to code this
    part.
    <#
    The .csv file should have the following headers (first line)
    GroupName,Status,Approver1,Approver2,Owner
    #>
    #Import CSV
    $csv = @()
    $csv = Import-Csv -Path "C:\TempAdd_Grp_Attrib.csv"
    #Loop through all items in the CSV
    ForEach ($item In $csv)
    $gname = $item.GroupName
    $attribs = @{'extensionAttribute2'=$item.Status; 'extensionAttribute3'=$item.Approver1; 'extensionAttribute4'=$item.Approver2; 'managedBy'=$item.Owner}
    Set-ADGroup -Identity $gname #-Replace $attribs
    mamadukes

    Yes. I am attempting to update the AD Group extension attributes.
    The code below works, but I know I can streamline this if I use the INSTANCE, which I am having an issue with (Set-ADGroup -Instance $Update)
    Import-Module ActiveDirectory
    <#
    The .csv file should have the following headers (first line)
    GroupName,Status,Approver1,Approver2,Owner
    #>
    #Import CSV
    $date = get-date -Format "MMddyyyymm"
    $csv = @()
    $csv = Import-Csv -Path "C:\Temp\Add_Grp_Attrib2.csv"
    #Loop through all items in the CSV
    ForEach ($item In $csv)
    $Update=(Get-ADGroup $item.GroupName -Properties extensionAttribute2,extensionAttribute3,extensionAttribute4,ManagedBy);
    $Update."extensionAttribute2"=$item.Status
    $Update."extensionAttribute3"=$item.Approver1
    $Update."extensionAttribute4"=$item.Approver2
    # Set-ADGroup -instance $Update
    Set-ADGroup -Identity $item.groupName -ManagedBy $item.Owner
    Get-ADGroup $item.GroupName -Properties extensionAttribute2,extensionAttribute3,extensionAttribute4,ManagedBy | select name,extensionAttribute2,extensionAttribute3,extensionAttribute4,ManagedBy | Export-Csv "C:\temp\Add_Grp_Attrib_Updates_$date.csv" -NoTypeInformation
    mamadukes

  • Error trying to run SSIS Package via SQL Server Agent: DTExec: Could not set \Package.Variables[User::VarObjectDataSet].Properties[Value] value to System.Object

    Situation:
    SSIS Package designed in SQL Server 2012 - SQL Server Data Tools
    Windows 7 - 64 bit.
    The package (32 bit) extracts data from a SQL Server db to an Excel Output file, via an OLE DB connection.
    It uses 3 package variables:
    *) SQLCommand (String) to specify the SQL Statement to be executed by the package
    Property path: \Package.Variables[User::ExcelOutputFile].Properties[Value]
    Value: f:\Output Data.xls
    *) EXCELOutputFIle (String) to specify path and filename of the Excel output file
    Property path: \Package.Variables[User::SQLCommand].Properties[Value]
    Value: select * from CartOrder
    *) VarObjectDataSet (Object) to hold the data returned by SQL Server)
    Property path: \Package.Variables[User::VarObjectDataSet].Properties[Value]
    Value: System.Object
    It consists out of 2 components:
    *) Execute SQL Task: executes the SQL Statement passed on via a package variable. The resultng rows are stored in the package variable VarObjectDataSet
    *) Script Task: creates the physical output file and iterates VarObjectDataSet to populate the Excel file.
    Outcome and issue:The package runs perfectly fine both in SQL Server Data Tools itself and in DTEXECUI.
    However, whenever I run it via SQL Server Agent (with 32 bit runtime option set), it returns the errror message below.
    This package contains 3 package variables but the error stating that a package variable can not be set, pops up for the VarObjectDataSet only.  This makes me wonder if it is uberhaupt possible to set the value of a package variable
    of type Object.
    Can anybody help me on this please ?
    Message
    Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 32-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  6:40:20 PM  DTExec: Could
    not set \Package.Variables[User::VarObjectDataSet].Properties[Value] value to System.Object.  Started:  6:40:20 PM  Finished: 6:40:21 PM  Elapsed:  0.281 seconds.  The package execution failed.  The step failed.
    Thank you very much in advance
    Jurgen

    Hi Visakh,
    thank you for your reply.
    So, judging by your reply, not all package variables used inside a package need to be set a value for when run in DTEXEC ?
    I already tried that but my package ended up in error (something to do with "... invocation ...." and that error is anything but clearly documented. Judging by the error message itself, it looks like it could be just about anything. that is why I asked my
    first question about the object type package variable.
    Now, I will remove it from the 'set values' list and try another go cracking the unclear error-message " ... invocation ...". Does an error message about " ... invocation ..." ring any bells, now that we are talking about it here ?
    Thx in advance
    Jurgen
    Yes exactly
    You need to set values only forthem which needs to be controlled from outside the package
    Any variable which gets its value through expression set inside package or through a query inside execute sql task/script task can be ignored from DTExec
    Ok I've seen the invocation error mostly inside script task. This may be because some error inside script written in script task. If it appeared after you removed the variable then it may because some reference of variable existing within script task.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Where is the swing.properties file?

    In J2SDK 1.5 beta, where is the swing.properties file.
    The file is supposed to be located in <Java Home>/lib/ but it is not there.
    Thanks,

    I'm not sure about 1.5, but normally there isn't one. The defaults are just used unless there is one.
    Look here
    http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/UIManager.html

  • How do I set the cal factor in a graph properties via a GUI

    How do I set the cal factor under properties in a graph window to different values using a GUI interface; button, or selector?

    Sorry about that, what I meant to say was "multiplier". I need two different multipliers at different times.
    Attachments:
    GraphProperties.PNG ‏40 KB

  • Question about static properties in implementation (.m) file

    I've been using some static properties in my implementation files so they can be accessed by class methods like so for example:
    #import etc
    static Class foo; // <-- Here is where I've been defining static properties
    @implementation Bar
    - init {
    foo = [Class new]; // initialize property
    + getObject { // now any where else in my code I can use [Foo getObject]
    return foo;
    - dealloc {
    [foo release];
    I've been doing this so that in other classes, I can simply go like:
    [Foo getObject]
    Can someone give me some more details about what's going on here though? It's been working but I'm nervous because I don't know much about it.
    ie. What kind of property is it? (nonatomic, retain)? Is this bad practice?
    Thanks to anyone who can shed some light on this.

    First off, it's not a property. It's a static variable. And the code you have isn't a good idea. Static variables should NOT be set via instance methods.
    Think about the following code:
    // In some other class
    Bar x = [[Bar alloc] init];
    Bar y = [[Bar alloc] init];
    Think about what just happened. In the 'foo' class you have now created two 'foo' objects and the first one is now leaked.
    The proper way to initialize static variables is with the 'initialize' class method. This is only ever called once, the first time the class is referenced.
    static Class foo;
    @implementation Bar
    + (void)initialize {
    foo = [[Bar alloc] init];
    - init {
    // Do nothing with 'foo'
    + (Bar)getObject {
    return foo;
    - (void)dealloc {
    // Do nothing with 'foo'
    The only downside, sort of, is that 'foo' is never dealloc'ed except when the app exits. But this isn't typically a problem.

  • How to set buildID.xml and custom.properties in SDK

    Hello,
    I just completed a new build deployment of SAP ME5.2, because after I deployed the new version, I don't think I have set a
    correct version number.Can you someone give me a sample how to set the buildID.xml and custom.properties? I am a new on the SAP ME5.2
    The Base version is ME_Base_5.2.5.16.5_netweaver-71_Update.zip and
    MEClient_Base_5.2.5.16.5_netweaver-71_Update.zip. the HB customzation
    version is ME_xxxxxx_2.0.0.0.x_netweaver-71.
    Within the sap note 1484551, you mentioned we need change the
    SDKInstallDir/build/buildID.xml file, here is the context of the file:
    buildID.xml -
    <?xml version="1.0" encoding="UTF-8"?>
    <buildID xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <customer>XXXXXX</customer>
    <revision>1.0.0.0</revision>
    <build>1</build>
    </buildID>
    buildID.xml -
    1. how can we change the revision and build?
    There is another file BuildToolDir/build/script/custom.properties, here
    is the file context:
    custom.properties----
    This file contains build properties used to configure the build
    system.
    The name of the software vendor implementing the customizations.
    vendor.name=xxxxxxxxx
    Vendor build identifier. This value is used to uniquely identify
    customizations built by a particular vendor for a particular customer
    and base
    application version.
    This is also used in path locations and in naming certain build
    artifacts, like the custom EJB module and the utility classes archive.
    vendor.id=xxxxxxxxx
    The installation of the J2EE engine installed in the development
    environment.
    ex. C:/usr/sap/CE1\J00
    j2ee.instance.dir=J2EEInstanceDir
    The web context path used to access the main web application. This
    is used by the build to set the
    context-root value in application.xml after an update has been
    imported.
    web.context.path=
    The web context path used to access the production XML interface web
    application. This is used by the build to set the
    context-root value in application.xml after an update has been
    imported.
    xml.context.path=
    The web context path to access resources from the web extension
    application, like images and work instruction HTML files.
    web-ext.context.path=web-ext
    The target database vendor. Valid values are 'oracle' or 'sqlserver'.db.vendor=ORACLE
    The JDBC driver configured for the application server.
    db.drivername=VMJDBC
    JDBC connection propertes for the WIP (Work In Process) database.
    This is the primary application database.
    db.wip.driverclassname=
    db.wip.driver.url=
    db.wip.host=
    db.wip.port=
    db.wip.sid=
    db.wip.user=
    db.wip.password=
    JDBC connection propertes for the ODS (Open Data Store) database.
    This is the offline reporting and archiving database.
    db.ods.driverclassname=
    db.ods.driver.url=
    db.ods.host=
    db.ods.port=
    db.ods.sid=
    db.ods.user=
    db.ods.password=
    Flag indicating whether to add DPMO NC codes to NC idat files when a
    new update is imported. This value is initially
    set by the installer according the the user selection.
    dpmo.nc.codes=
    The default locale used by the production system. The default locale
    is the locale used to display locale
    specific text and messages when the requested locale is not
    available. This property does not need to
    be set if the default locale is english.
    default.locale=en
    Used when running the build from Eclipse to locate the java compiler
    used by the WebLogic EJB compiler.
    jdk.home=C:/Program Files/Java/jdk1.5.0_20
    Compiler debug mode. If set to 'true', debug symbols will be
    compiled into the byte code.
    compile.debug=true
    Keystore alias
    security.alias=xxxxx
    Keystore password
    security.storepass=ChangeIt
    Key password
    security.keypass=ChangeIt
    Keystore type (jks=default,jceks,pkcs12)
    security.storetype=jks
    Optional source control build identifier that is to be displayed with
    standard version information.
    scs.build.ID=
    Optional extended version information to be displayed with standard
    version information.
    ext.info=
    custom.properties----
    2. How can we change this here?
    Regards,
    Leon Lu
    Edited by: Leon Lu on Aug 4, 2011 11:14 AM
    Edited by: Leon Lu on Aug 4, 2011 11:21 AM

    Hi,
    I created one request with logo in the header an page in the footer etc. and called StyleSheet. After you can import this formats by each request.
    You can do this in compound layout.
    Regards,
    Stefan

  • How to set proxy authentication using java properties at run time

    Hi All,
    How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
    => Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
    import java.io.*;
    import java.net.*;
    public class DnldURLWithoutUsingProxy {
       public static void main (String[] args) {
          URL u;
          InputStream is = null;
          DataInputStream dis;
          String s;
          try {
              u = new URL("http://www.yahoo.com.au/index.html");
             is = u.openStream();         // throws an IOException
             dis = new DataInputStream(new BufferedInputStream(is));
             BufferedReader br = new BufferedReader(new InputStreamReader(dis));
          String strLine;
          //Read File Line By Line
          while ((strLine = br.readLine()) != null)      {
          // Print the content on the console
              System.out.println (strLine);
          //Close the input stream
          dis.close();
          } catch (MalformedURLException mue) {
             System.out.println("Ouch - a MalformedURLException happened.");
             mue.printStackTrace();
             System.exit(1);
          } catch (IOException ioe) {
             System.out.println("Oops- an IOException happened.");
             ioe.printStackTrace();
             System.exit(1);
          } finally {
             try {
                is.close();
             } catch (IOException ioe) {
    }However, it generated the following message when run behind the firewall:
    cd C:\Documents and Settings\abc\DnldURL\build\classes
    java -cp . DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:320)
    at sun.net.www.http.HttpClient.New(HttpClient.java:315)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    I have also tried the command without much luck either:
    java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
    There is no problem pinging www.yahoo.com from this system.
    I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
    I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
    Java Control Panel - Use browser settings without success.
    Thanks,
    George

    Hi All,
    How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
    => Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
    import java.io.*;
    import java.net.*;
    public class DnldURLWithoutUsingProxy {
       public static void main (String[] args) {
          URL u;
          InputStream is = null;
          DataInputStream dis;
          String s;
          try {
              u = new URL("http://www.yahoo.com.au/index.html");
             is = u.openStream();         // throws an IOException
             dis = new DataInputStream(new BufferedInputStream(is));
             BufferedReader br = new BufferedReader(new InputStreamReader(dis));
          String strLine;
          //Read File Line By Line
          while ((strLine = br.readLine()) != null)      {
          // Print the content on the console
              System.out.println (strLine);
          //Close the input stream
          dis.close();
          } catch (MalformedURLException mue) {
             System.out.println("Ouch - a MalformedURLException happened.");
             mue.printStackTrace();
             System.exit(1);
          } catch (IOException ioe) {
             System.out.println("Oops- an IOException happened.");
             ioe.printStackTrace();
             System.exit(1);
          } finally {
             try {
                is.close();
             } catch (IOException ioe) {
    }However, it generated the following message when run behind the firewall:
    cd C:\Documents and Settings\abc\DnldURL\build\classes
    java -cp . DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:320)
    at sun.net.www.http.HttpClient.New(HttpClient.java:315)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    I have also tried the command without much luck either:
    java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
    There is no problem pinging www.yahoo.com from this system.
    I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
    I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
    Java Control Panel - Use browser settings without success.
    Thanks,
    George

  • Pdf files in search results - open the properties paga instead the file

    Hi,
    We have 2010 search results page for searching files. When the search result is a pdf - the icon shown is not pdf icon and when click the file name it opens the properties page instead the file itself. What should be set? thanks a lot
    keren tsur

    It looks like you didn't register PDF file type in your search service application.
    Go to Central Administration->Manage Service Application. Click on the name of your search service application and check file types (link in the left column)

  • KM Std Properties via API: can be done!

    Hi guys,
    This is to let you know that <b>std resource properties</b> (created by, created on, changed by, changed on, content length, ...) <b>can indeed be set using KM API's</b>.
    Maybe this is not great surprise to someone, but it is for me, that after reading this <a href="https://www.sdn.sap.com/irj/sdn/thread?threadID=25606">thread</a> was very very scared...
    Well, here's the code that worked for me on EP 6 SP 16 (honestly I don't see any serious reason for which it shouldn't be running on EP5 and EP7 as well... believe me: I decompiled a lot):
    final String cmadmin = "cmadmin_service";
    context = factory.getServiceContext(cmadmin);
    com.sapportals.portal.security.usermanagement.IUser puser = context.getUser();
    puser.setTransientAttribute("--km-change-systemproperties--", new Boolean(true));
    Basically, create a context with the std service user cmadmin_service, and then set its "km-change-systemproperties" trasient attribute to true. Done!
    For <i>the rest of the story</i> (how to set properties, etc), see KM API documentation under IResource interface or search SDN with "km api properties".
    Cheers,
    Alex

    Hi Alex
    Thanks for the reply. Here is the code:
    Folder Structure:
    documents
         testfolder
             Folder 1
                Some files here
            Folder 2
                 Empty
             Folder 3
                  Some more files here
    try{
         String rLocationtest = "/documents/testfolder" ;
         IResourceContext c = ResourceFactory.getInstance().getServiceContext("cmadmin_service");
         IUser user = c.getUser();
         user.setTransientAttribute("--km-change-systemproperties--", new Boolean(true));
         ICollection collection = (ICollection)ResourceFactory.getInstance().getResource(RID.getRID(rLocationtest),c);
         loopFolder(collection,c,response);
    catch(Exception e){
        e.printStackTrace();
    public void loopFolder(ICollection collection, IResourceContext c, IPortalComponentResponse response){
    try{
             IResourceList resList = collection.getChildren();
          IResourceListIterator resItr = resList.listIterator();
              while(resItr.hasNext()){
         IResource restemp = resItr.next();
         if(restemp.isCollection() && LinkType.NONE.equals(restemp.getLinkType())){
              loopFolder((ICollection)restemp,c,response);
    IPropertyName modifiedByPropertyName = new PropertyName("http://sapportals.com/xmlns/cm","modifiedby");
    IPropertyName createdByPropertyName = new PropertyName("http://sapportals.com/xmlns/cm","createdby");
    //get the properties          
      IProperty resMProperty = restemp.getProperty(modifiedByPropertyName);
      IProperty resCProperty = restemp.getProperty(createdByPropertyName);                    
    //get mutable properties
    IMutableProperty mutableModifiedByProperty = resMProperty.getMutable();
    IMutableProperty mutableCreatedByProperty = resCProperty.getMutable();               
    //set mutable properties
    mutableModifiedByProperty.setStringValue("Administrator");
    mutableCreatedByProperty.setStringValue("Administrator");
    //set the resource with new properties
    restemp.setProperty(mutableModifiedByProperty);
    restemp.setProperty(mutableCreatedByProperty);
    response.write("Changed modified and created");
    }// End of while
    }catch(Exception e){
         e.printStackTrace();
      }//End of catch
             } //End of loopFolder
    It updates only createdBy field and not the other one. If I modify one at a time instead of two, it works fine.
    Thanks
    Deepak

  • Exception while loading properties from an xml file

    Hi all,
    I've got a problem while loading properties from an XML file:
    java.lang.ClassCastException: org.apache.xerces.dom.DeferredCommentImpl cannot be cast to org.w3c.dom.Element
    ERROR - Cannot load properties from the specified file <./conf/login.prop> java.lang.ClassCastException: org.apache.xerces.dom.DeferredCommentImpl cannot be cast to org.w3c.dom.Element
         at java.util.XMLUtils.importProperties(XMLUtils.java:97)
         at java.util.XMLUtils.load(XMLUtils.java:69)
         at java.util.Properties.loadFromXML(Properties.java:852)
         at g2.utility.HRPMProperties.<init>(HRPMProperties.java:78)
         at g2.utility.HRPMProperties.getInstance(HRPMProperties.java:94)
         at g2.gui.workers.ApplicationSwingWorker.<init>(ApplicationSwingWorker.java:36)
         at g2.main.Main.main(Main.java:37)but this code worked before, and I've got the xerces and xercesImpl packages in the classpath, anyone can give me an hint on how to fix the problem?

    Here there's the code that instantiates the HRPMProperties object loading the property file:
    public class HRPMProperties extends Properties {
         * A reference to myself.
        protected static HRPMProperties mySelf = null;
         * The property file to which load the configuration.
        protected static String propertyFile = "./conf/login.prop";
          * A set of static strings used as keys in the properties file.
         public final static String DATABASE_URL = "database_url";
         public final static String DATABASE_USERNAME = "database_username";
         public final static String DATABASE_PASSWORD = "database_password";
         public final static String REAL_USERNAME = "real_username";
         public final static String REAL_PASSWORD = "real_password";
         public final static String PHANTOM_LOGIN = "login_thru_phantom_user";
         public final static String AUTOCONNECT = "autoconnect";
         public final static String TRANSLATION_FILE = "translation_file";
         * Builds up an empty properties map.
        protected HRPMProperties(){
         super();
         this.reload();
         * Builds up the property map from the specified input file. <B> The file must be in XML format</B>.
         * In case of exception and/or problems reading from the specified file, an empty property map is returned.
         * @param fileName the path and the name of the file with the XML representation of the properties.
        protected HRPMProperties(String fileName){
         super();
         try{
             this.loadFromXML(new FileInputStream(fileName));        
         }catch(Exception e){
             Logger.error("Cannot load properties from the specified file <"+fileName+"> " + e);
             e.printStackTrace();
         * Provides an instance of the property class loaded from the default configuration file.
         * @return the property instance
        public static final HRPMProperties getInstance(){
         if( HRPMProperties.mySelf != null )
             return HRPMProperties.mySelf;
         else{
             HRPMProperties.mySelf = new HRPMProperties(HRPMProperties.propertyFile);
             return HRPMProperties.mySelf;
    }The constructor is the one triggering the exception, so there's a problem loading the XML property file.

  • Printing envelope and cont. to print from phototray set made main tray in properties?????

    envelope wizard keeps printing from phototray. have changed setting to main tray in properties and cont. phototray???

    Unfortunately any image file sent to ePrint will automatically be printed out on photo paper with printers that have a seperate photo tray.
    Depending on how you are ePrinting, you do have a few options though. If you are printing from a Apple or Android device, their is an app that will allow you to choose the paper size and type when printing.
    For Apple products, you want the HP ePrint app.
    For Android based devices, you want the HP ePrint Home & Biz app.
    If you are printing from a computer, you can download the ePrint Mobile Driver and that will also give you those options.
    Reply back with how you are printing and let me know if you need any help getting this set up.
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------

  • Add company logo to Windows Properties via batchfile

    do not worry. Had to run it with elevated permissions.

    Hello,
    I want to add the company logo to the Computer Properties page via a batch file. I have already successfully done this via regedit but want it via batch so as to use it via GP
    my current code is:
    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation" /v "Logo" /d "C:/logo.bmp"
    but it is not working.
    any tips?
    This topic first appeared in the Spiceworks Community

  • How do I add to "properties" of an MP3 file in Windows so iPod will accept?

    I posted a problem yesterday, which I was clueless about. Today I know what the problem is, but don't know how to fix it.
    I have 30 MP3 files in a playlist, all from an identical album. I can play every file on my computer through iTunes with no problems. HOWEVER.... my iPod only "recognises" 23 of the 30 files and won't accept the remaining 7.
    I have updated the "info" part of the tags, made it a compilation etc. THat didn't work. THe problem is the the amount of detail in the "properties" section of each file. The 23 that the iPod will accept have many details in the properties section ... eg. artist, title, duration, audio etc etc .. the 7 that will not migrate across only have two details - "type" and "size"...
    SOOO my question is: How do I add to the "properties" of the MP3 files in Windows so the iPod will accept them?
    Would really appreciate some help here, its drivin me nutz!!

    Hi,
    As it didn't work in iTunes, I'm not sure completing the id3 fields for your 7 files through another app will correct the problem. But in any case, one program I use to edit id3 tags is ID3-TagIT. It's freeware.
    http://www.id3-tagit.de/
    Good luck.

  • Acrobat Properties - How can I set a default group of properties?

    I have been unable to determine how to create a default set of properties. Every time I create a pdf, I have to go into the properties and set the document to open with a set of properties specific to my needs. It requires me to change the Description and all of the settings in Initial View and Security. Surely I can do this once and save it as a default. Can anyone advise?
    Thanks in Advance,
    Brad Brusenhan

    Set the defaults in the printer properties. Not within a program as they only change for that use of the program, but in the properties of the printer (Start>Printers> right click on your printer and select properties). Some properties can be set in Distiller, but generally the printer properties overrides the choices in Distiller.
    I am not sure if there is any other way to make the PDF Maker selections stick - they may be kept according to the preferences set within the application, but I am not sure (I don't use PDF Maker much).

Maybe you are looking for