Best setup for a swing application

Hello,
I have developed an Swing application for a EPOS machine.
The machine has around 512 ram.
What's the best setup for me in terms of performance, for example, which JVM to use etc.....
Cheers
Bobby

bsbiran wrote:
Hi,
Well the app require alot of images and I parts of it do run 'slow'
...I'm currently going through a book about Swing and read that many times the "slowness" of a Swing-application can be credited to the programmer for not using the API efficiently/correctly (letting the app repaint too much, or repainting large parts that don't need repainting at all, to name just two things). So, I don't know how much of a Swing-guru you are, but it might be better to read a few decent Swing tutorials or pick up a good Swing book.

Similar Messages

  • Best setup for a non-Mac file server?

    I have a dual xeon server, with a SATA RAID5 I want to use as a file server in a cross-platform environment.
    *What I've tried and the issues...*
    At first I considered using Windows 2003 (Win2k3) but Services for Macintosh (SFM) is an older version of AFP and thus only supports 31 character filenames. With all our Macs supporting SMB/Samba/CIFS and Apple touting that "Macs and PCs can co-exist harmoniously on the same network" I figured I would give that a try.
    SMB doesn't work.
    Sure I can create a connection, but transferring files is a completely different story. I'm trying to backup application and system data, but companies such as Adobe and Apple have named some of their files with special characters that can't be transferred over SMB. I know NTFS doesn't support these characters, but I though a Linux box using SMB would work fine. It doesn't. It's the protocol which keeps me from transferring the data. I end up with the lovely error message of "You cannot copy some of these items to the destination because their names are too long or contain invalid characters for the destination..." (what's sad is, if you google for " because their names are too long or contain invalid characters for the destination" you only get 6 results.)
    So I thought I would give NFS a try. Apple says "Viewed from Mac OS X, [connecting via NFS] is just like connecting to an Apple or Windows server." No. It's not. NFS shares don't even show up in the Finder's Network listing. There are also a pile of other hurdles which are only tackled by savvy, command-line using users.
    So that leaves me with AFP. Win2k3 doesn't support filenames longer than 31 characters, and Win2k8 is dropping SFM altogether. Off to choose a *nix flavor, but that requires Netatalk. It hasn't been updated in years, it has many bad performance reviews... and most distros have removed it. I can download and install it. Oh, but that requires I get the kernel source files. Then I have to create an RPM an that's not working... now I'm several levels deep in trying to figure out how to get Netatalk working and I'm not even sure it will work.
    *What's the best setup for a non-Mac file server?*
    FreeNAS seems promising, but it's in alpha/beta and they have all sorts of warnings regarding potential data loss. Sure there's ExtremeZ-IP, but I really don't want to spend $675 do something Apple claims OS X can already do. I can put just about any non-Mac OS on this thing... what's the best way to set it up so it works?
    Thanks much.

    Rick may be right because although i didnt think of it before i tend to have notoriuosly long classnames for my php classes and i have used samba on occasion (when rsync is out of the question for one reason or another) and never had a problem. I use kubuntu (feisty at the moment )with an ext3 filesystem. if i have a chance this evening ill give it a try and see what happens.
    You could also possibly use FUSE to use an ssh filesystem for the shares... i don tknow how that would figure in your back up though.
    Also if worse comes to worse you could tar or dmg the the necessary files... just some thoughts.
    Ill be interested to know what you end up implementing....
    OH one last thought... Compile Darwin from source and use that as your server

  • Best setup for iMac with SSD & HDD? Best location of scratch & home folders

    Best setup for iMac with SSD and HDD? Best location of scratch & home folders?
    Computer:
    iMac 2.93 GHz Quad core i7, 8GB RAM, 1 TB HDD + 256 GB SSD
    There is not much info from Apple about the best way to set up an iMac with a Hard Drive and Solid state drive. I’ve looked at a few of the forum posts across the web and came up with a plan and lots of questions. (I do use photoshop frequently, but not on a professional level):
    1. I will keep OS and Applications on SSD
    2. About moving the home folder: I saw some posts about moving the whole home folder, but it makes more sense to me to only move selected fodlers withing the home folder tomake the best use of the SSD. So will keep the home folder on SSD, but move certain folders (document /music/iphoto/download) to 1 TB HDD via instructions I found on the macintoshperformanceguide website:
    cd
    sudo cp -r Documents /Volumes/Master
    sudo rm -rf Documents
    sudo ln -s /Volumes/Master/Documents Documents
    3. I would like to get 8 more RAM when I can afford it
    4. I will attach an external hard drive for most of my documents and backup storage
    5. Now here is where I’m not sure what’s best:
    a. Should I partition my internal 1 TB hard drive and use the first partition as a scratch disc for photoshop and other applications? How much should I partition? Is there any benefit to this if the rive is partitioned?
    b. Should I use an external drive as a scratch disc?
    c. Any advice on a good 1-2 TB external drive?
    d. Should I just leave things in factory settings?
    Don't assume I know the basics - I got all the above just by searching around. Any advice and commentary is appreciatedThanks.
    Message was edited by: sfandtheworld

    Thanks for the advice and the links. yes, I would like to speed up ps as much as possible.
    I wonder if putting the scratch disc on the same drive as the OS would cause them to interfere with each other? Even if they are on different partitions, they would not be able to be accessed at the same time, or could they? That's why I was wondering if I should place scratch disc on the internal HDD -- but then I don't know how much to partition for it (or to partition at all?)
    ALso, I read on a few places that too much read/write on the SSD wears it down over time? Is this more of a theoretical concerns - it does not make sense to me since it has no moving parts!
    thanks again for the advice ... I'm gonna go digest those links

  • BackGround picture for a Swing application??

    hi,
    once I got a nice idea while watching some webpages. we can give a background picture for a webpage in <body> tag?
    I want to do same thing for any Swing application. Currently I am working on that issue. Any suggestions are welcome!!
    santhosh

    Hi everybody!
    Finally I got it. now Using this We can enable background for any swing application.
    the complete code is shown here. If you have any problems regarding this code, please mail to [email protected]
    /******************************[TexturedImageIcon.java]***********************/
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import javax.swing.*;
    /* this is used to generate a tiled image from a given image file.*/
    public class TexturedImageIcon extends ImageIcon
         private Dimension size = new Dimension(10, 10);
         BufferedImage bimg1,bimg;
         Graphics2D g2;
         ComponentListener cl = new ComponentAdapter(){
              public void componentResized(ComponentEvent ce){
                   Component c = (Component)ce.getSource();
                   size = c.getSize();
                   createImage();
         public void setImage(String filename){
              super.setImage(new ImageIcon(filename).getImage());
              bimg1=null;
              createImage();
         public TexturedImageIcon(Component comp, Image img){
              super(img);
              addListener(comp);
         public TexturedImageIcon(Component comp, String filename){
              super(filename);
              addListener(comp);
         public TexturedImageIcon(Component comp, URL url){
              super(url);
              addListener(comp);
         private void addListener(Component comp){
              comp.addComponentListener(cl);
         private void createImage(){
              bimg = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
              g2 = bimg.createGraphics();
              Rectangle2D rect = new Rectangle2D.Float(0,0,size.width-1, size.height-1);
              Rectangle2D tr = new Rectangle2D.Double(0,0,super.getIconWidth(), super.getIconHeight());
              if(bimg1==null){
                   bimg1 = new BufferedImage(super.getIconWidth(), super.getIconHeight(), BufferedImage.TYPE_INT_RGB);
                   Graphics2D g = bimg1.createGraphics();
                   g.drawImage(super.getImage(), null, null);
              TexturePaint tp = new TexturePaint(bimg1, tr);
              g2.setPaint(tp);
              g2.fill(rect);
         public int getIconWidth(){ return size.width; }
         public int getIconHeight(){ return size.height; }
         public Image getImage(){
              System.out.println("asked");
              return bimg;
         public void paintIcon(Component c, Graphics g, int x, int y){
              Graphics2D g2d =(Graphics2D)g;
              g2d.drawImage(bimg, null, null);
         public static void main(String[] args){
              JFrame f = new JFrame();
              f.setSize(300,300);
              JLabel label = new JLabel();
              label.setBackground(Color.white);
              label.setBorder(BorderFactory.createRaisedBevelBorder());
              label.setIcon(new TexturedImageIcon(label, "world2.gif"));
              f.getContentPane().setLayout(new BorderLayout());
              f.getContentPane().add(label, BorderLayout.CENTER);
              f.show();
    /*********************************[JFCUtils.java]************************/
    /*The main logic to enable background picture lies in this class*/
    public class JFCUtils{
         public static ContainerListener cl = new ContainerAdapter(){
              public void componentAdded(ContainerEvent ce){
                   JComponent child = (JComponent)ce.getChild();
                   child.setOpaque(false);
                   child.addContainerListener(this);
                   addlisteners(child);
         public static TexturedImageIcon enableBackGround(JFrame f, String filename){
              ((JPanel)f.getContentPane()).setOpaque(false);
              JLayeredPane lp = f.getLayeredPane();
              JLabel label = new JLabel();
              TexturedImageIcon icon = new TexturedImageIcon(label, filename);
              label.setIcon(icon);
              JPanel panel = new JPanel(new BorderLayout());
              panel.add(label, BorderLayout.CENTER);
              lp.add(panel, new Integer(Integer.MIN_VALUE));
              Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
              panel.setBounds(0, 0, screen.width,screen.height);
              addlisteners((JComponent)f.getContentPane());
              return icon;
         private static void addlisteners(Component c){
              c.toString();
              if(c instanceof JComponent) ((JComponent)c).setOpaque(false);
              if(c instanceof Container){
                   Container ct = (Container)c;
                   ct.addContainerListener(cl);          
              for(int i=0; i<ct.getComponentCount(); i++){ //recursivly make all subcomponents transparent
                   Component child = (Component)ct.getComponent(i);
                   addlisteners(child);
         public static void main(String[] args){
              JFrame f = new JFrame();
              enableBackGround(f, "bg.jpg");
              JButton b = new JButton("fdfdfdfd");
              f.getContentPane().add(b, BorderLayout.NORTH);
              f.setSize(300,300);
              f.show();
    /*************************************[UserDialog.java]**************************/
    //to check how a swing application with background looks like
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class UserDialog extends JDialog
         JPanel contents = (JPanel)getContentPane();
         JTextField shortField = new JTextField(20);
         JTextField nameField = new JTextField(20);
         JTextField emailField = new JTextField(20);
         JTextField smtpServerField = new JTextField(20);
         JTextField pwdField = new JPasswordField(20);
         JTextField pwdField1 = new JPasswordField(20);
         boolean okay = false;
         public UserDialog(JFrame owner){
              super(owner, "New User Details", true);
              initComponents();
              pack();
              setResizable(false);
         public UserDialog(JDialog owner){
              super(owner, "New User Details", true);
              initComponents();
              pack();
              setResizable(false);
         private void initComponents(){
              JPanel west = new JPanel(new GridLayout(0, 1));
              west.add(new JLabel("Short Name"));
              west.add(new JLabel("Full Name"));
              west.add(new JLabel("Email"));
              west.add(new JLabel("SMTP Server"));
              west.add(new JLabel("Password"));
              west.add(new JLabel("Confirm Password"));
              JPanel east = new JPanel(new GridLayout(0, 1));
              east.add(shortField);
              east.add(nameField);
              east.add(emailField);
              east.add(smtpServerField);
              east.add(pwdField);
              east.add(pwdField1);
              JPanel south = new JPanel();
              JButton ok = new JButton("Ok");
              JButton cancel = new JButton("Cancel");
              south.add(ok);
              south.add(cancel);
              contents.setBorder(JFCUtils.border);
              contents.setLayout(new BorderLayout(10, 10));
              contents.add(west, BorderLayout.WEST);
              contents.add(east, BorderLayout.EAST);
              contents.add(south, BorderLayout.SOUTH);
              ActionListener al = new ActionListener(){
                   public void actionPerformed(ActionEvent ae){
                        okay = ae.getActionCommand().equals("Ok");
                        setVisible(false);
              ok.addActionListener(al);
              cancel.addActionListener(al);
         private void clearFields(){
              shortField.setText("");
              nameField.setText("");
              emailField.setText("");
              smtpServerField.setText("");
              pwdField.setText("");
              pwdField1.setText("");
         public User getUser(){
              clearFields();
              okay = false;
              show();
              if(okay) return new User(shortField.getText(), nameField.getText(), emailField.getText(), smtpServerField.getText(), pwdField.getText());
              else return null;
         public static void main(String[] args){
              Dialog dlg = new UserDialog();
              TexturedImageIcon ticon = JFCUtils.enableBackGround(f, "bg.jpg");.show();
              //we can change the background picture by calling ticon.setImage(...) at runtime.

  • Accelarate the Linux ATI Graphics card  for java Swing application

    Hi All,
    I am using a ATI Radeon 9550 Graphic card in LFS (Linux from the scratch) environment. I want to enable the OpenGL-based pipeline for Java Swing application. I tried the -Dsun.java2d.opengl=true . But the Java swing application getting very slow.
    How to overcome this problem?
    Any one give the procedure to Accelerate ATI graphics card for Java Swing Application
    How to verify Java swing use ATI graphics card ?
    Thanks in advance..
    Prabhu.S

    Hi All,
    I am using a ATI Radeon 9550 Graphic card in LFS (Linux from the scratch) environment. I want to enable the OpenGL-based pipeline for Java Swing application. I tried the -Dsun.java2d.opengl=true . But the Java swing application getting very slow.
    How to overcome this problem?
    Any one give the procedure to Accelerate ATI graphics card for Java Swing Application
    How to verify Java swing use ATI graphics card ?
    Thanks in advance..
    Prabhu.S

  • Need advice on best setup for Extreme and Express w/ (n only) network

    I'd like to get some advice on the best setup for my situation. I've read a number of posts on WDS, Extending a Network, etc. and, unfortunately, I'm now more confused than ever.
    We have an Airport Extreme 802.11n using WPA2 Personal, 2.4Ghz (n only connection) which I've found to give us the best range/connection speeds for the following devices (all computers running 10.5.5, Apple TV's using most current update):
    (2) MacBooks
    iMac
    (2) AppleTVs
    The good news we have a large house, the bad news we have a large house. Meaning of course that I don't get the range in parts of the house I'd like to. I also have an older Mini (G4) connected to the AEBS thru ethernet (the Mini acts as the iTunes server for the ATVs).
    I just bought a new Airport Express with the desire to place it on the other side of the house to both enhance the range of the wireless network and to provide another wired to wireless connection to the network.
    I initially merely chose to "Extend a wireless network" but that seems to have a MAJOR adverse impact on the speeds of the wireless network. dropping the streaming to one of the ATV by like 90%. I would like to maintain the security settings I have as well as the 2.4Ghz (n only) since these provide the best speed/connection range on the AEBS.
    My question then is what is the best way to use the AX (WDS? Bridge?).

    The best way to use it is the option you chose "Extend a wireless network".
    WDS forces you to the much slower 802.11g and even cuts that bandwidth in half.
    Operating as a bridge has nothing to do with wirelessly extending a network. Changing this option won't have any effect on wireless bandwidth.

  • Best directory for isnatlling Unix Applications in Snow Leopard?

    Can someone advise me on the best location for installing Unix Applications in Snow Leopard? Should I install them in /usr/local or create a new /opt directory for them? My understanding is that OS X 10.6 does not come with /opt. I prefer to install manually and not use third party software (e.g. Fink).
    Many thanks.

    If you are downloading and compiling your own sources, then /usr/local/... would be the expected location.
    If you are using the MacPorts.org already ported packages, then get placed in /opt/local/...
    If you are using Fink.sf.net already ported packages, then the get placed in /sw/...
    And for a few Unix tools at work, and I can not modify my host system, I put it in $HOME/local/..., which works for me because my company uses NFS to allow the use of my same home directory on multiple systems. This works as long as I do not exceed my corporate home directory storage quota
    Message was edited by: BobHarris

  • Best Setup For Frequent File Sharing On Home Network?

    Hi guys,
    I'm setting up an office at my house with multiple computers on a network, and we'll be sharing files over the network frequently. My question is, what is the best setup for this?.. Fastest transfer of files, stable wireless connection, etc.
    All of the computers will be Macs (iMacs and Macbooks).
    We'll be editing videos/photos on the computers. (Potentially large files)
    Is the easiest setup just to have the main computer attached to a good router, setup file sharing on all other computers, and just do it that way?
    Or would it be better to create some sort of NAS?
    Also can someone reccomend a good router for this type of scenario?
    Thanks for any help given.

    NAS is the right tool for this job.
    It is expensive but the market leaders.. synology and QNAP have really been doing it for long time and the ability to do file store/sharing and most importantly backup in these is excellent. Pick the best you can afford.. and buy disks that are in the recommended list. ie the cheapest are not always the best.. indeed they seldom are.
    Plan very carefully for rotation of USB drives (easy and cheap now with 4TB single drives). Rotate backups with offsite location on weekly basis.
    I would buy a 4 disk case.. you can use 4x3TB which are the best value at the moment.. that gives you 9TB of storage.. plus redundancy for a dead drive.
    Alternatives are using a Mac Mini as a server.. with a large stack of disks on it.. generally should be thinking thunderbolt if you want speed. Hideously expensive though for now.
    You can buy an Extreme or TC.. either would work well. TC allows you easy TM backups without using your NAS..
    Edit very large files on the computer. ie copy to computer.. edit.. copy back to the NAS.
    Editing very large files over wireless.. not good. Multiply that by mutliple computers.. not even fair.
    Copy a large project to the computer.. work on it.. copy back to the NAS.. in the meantime Time Machine should be able to take care of incremental backups.
    There are heaps and heaps of solutions.. as long as it is logical and easy to you.. and covers what you need.
    Don't skimp.. spending a $1000 for a NAS with disks.. plus extra for the backup disks.. that represents how many day's work for you plus anyone you have helping.. $$$$ ????
    A mini as a server is a good alternative.. You don't need to run server OS.. but share files to the network. Very hard to build the capacity of the NAS though.
    And a Mac Pro is now a joke without internal slots and cages for drives. (nice machine but wrong for this).
    And Apple have nothing in between.. a short tower case.. been missing for a long long time.

  • Book Recommendation for Building Swing Applications

    I'm looking for recommendations on books for building swing applications from the ground up.
    I'm not a strong GUI developer. 95% of my experience has been strictly on back end development in many other languages. What little GUI experience I have has been with C++ (years ago) and most recently with HTML.
    I know what I want to develop, and even have the GUI design for my application drawn out. I just need a good book that can walk me through developing the interface in Java.
    I already have several books on Java. But, I find them somewhat limiting because they don't help me build the app from the ground up.
    Yes, I've tried the online book on the Sun site, "The Jfc Swing Tutorial: Guide to Constructing Gui's".
    Please offer some recommendations and reasons on why you like the book.
    Thanks.

    A few comments to that ....
    the first thing is understanding the LayoutManagers, that are available.
    I will give you a short guideline where they are usefull:
    FlowLayout - usefull for JLabel-JTextField combinations or several JButtons
    BorderLayout - usefull for the structure of basic containers
    CardLayout - usefull for every area of the screen, where you want to appear different panels
    GridLayout - usefull for a group of same-sized components laid out in a grid
    GridBagLayout - usefull for a group of components, that have different sizes, very flexible
    JTabbedPane - a special container, that is similar to CardLayout but with visible tabs to switch panels
    Normally you can say "I want that group at the bottom of the frame, that other group at its left side, that toolbar at its top" - if you can say so - that shouts for BorderLayout. If you can say "in this area I want to use several panels" that means CardLayout or a JTabbedPane.
    You see, if you have an idea, what the LayoutManagers do, you know exactly which area needs what Layout - so you have a guideline, which LayoutManager to use in that panel.
    To make an example:
    You want 3 buttons centered at the bottom of a frame - this 3 buttoms should be of that size, that is needed by the button texts. So, what to do:
    1. create a JPanel with FlowLayout
    2. create the buttons and add it to that JPanel
    3. create another JPanel with BorderLayout
    4. add that first JPanel to the second JPanel at BorderLayout.CENTER
    5. add this Panel to the ContentPane of the frame at BorderLayout.SOUTH
    that is a simple panel in panel construct - placing 3 buttons centered at the bottom of the frame. You have to play with that different LayoutManagers a little bit - the way you stick one panel in another changes the look of the GUI - if you know, how it changes (by playing with the examples of the tutorial), you will have that "from the ground"-experience, you are looking for - believe me.
    greetings Marsian

  • Just bought a 3TB Time Capsule for a small office. Will have 4 users with MacBooks. What would ne the best setup for time machine individual backups and internet sharing in a secure way?

    Just bought a 3TB Time Capsule for a small office. Will have 4 users with MacBooks. What would ne the best setup for time machine individual backups and internet sharing in a secure way?

    Set up each Mac for Time Machine backups in the normal way.  Time Machine will keep each backup separate on the Time Capsule, so users will only be able to see the backups of their own Mac.
    Yes....there are convoluted workarounds that might allow one user to see the backups of another.....IF...they know the administrator password of the "other" Mac.
    As far as Internet sharing, all users will have access to the Internet if they have a wired or wireless connection. If a Mac connects using wireless, it is possible to limit the time that they are allowed to connect to the network.
    For example, you might limit the ability to connect to the wireless from say each Weekday from 8 AM to 6 PM.
    With a wired Ethernet connection, you cannot limit access times to the Internet.

  • How to setup JAWS for Java Swing applications

    Hello All,
    I am having one swing application and need to test with JAWS.Could you please let me know the configuration steps.I tried with the following steps and it is not working properly.
    1. Install JDK1.5.0_08
    2. Install JAWS 7.0
    3. Install SUN accessbridge-2_0_1
    4. Copied access-bridge, jaccess-1_4 and accessibility.properties to jre\lib\ext
    it is not identifying even buttons also.
    Thanks & Regards,
    Gana

    Hello there,
    Gana, Ana
    I have the same problem
    1. Install JDK1.5.0_08
    2. Install JAWS 7.0
    3. Install SUN accessbridge-2_0_1
    4. Copied access-bridge, jaccess-1_4 and accessibility.properties to jre\lib\ext
    and nothing

  • Best way for building an application main frame

    I'm about to program a desktop application.
    The main frame will have menus, toolbar, status bar etc.
    There will be a lot of interaction between the menus, toolbar buttons and other custom gui components (such as an editor).
    My question is which is the best way for building it.
    Cramming all the code in one class file is out of the question.
    I thought about making my own custom JFrame and add API functions like for it so different GUI elements can be accessed.
    Each component which will be manipulated will be in its own class file with the constructor accepting a reference to my custom JFrame object which it is contained in.
    Any suggestions on the matter would be of great help since I've never done extensive Swing programming before.
    P.S.
    The application makes extensive use of RMI.
    What considerations should I take into account (except using SwingUtilities.invokeLater()) ?

    Hi,
    I have replied on this subject somewhere else today but what I do is have one simple entry point where I just instanciate a JFrame.
    On that frame I have a main JPanel. On that panel I add new objects like JPanels, tabs etc.
    I keep each new panel in a separate source as it is easier when the application grows, and it will. That also means that several programers can work with the same application without interfearing each other.
    I hope you understand what I mean the the thing is to split up the code into several sources.
    It may not suit everyone but I found this approach to be the best for me.
    Klint

  • Best practice for mouseless ADF applications

    I am developing an ADF application where the users do not want to use the mouse.
    So I would like to know if there are a best practice for this?
    I am already using the accessKey functionality and subforms defaultCommand
    But I have had problems setting focus to objects on a page like tables. I would like a button to return the focus to the table after it has made the command like delete.
    I have implemented a solution where I have found inspiration several threads and other webpages (see below).
    Is this solution okay?
    Are there any problems with it?
    I would also like to know if there are better pathways to go like
    out of the box solutions,
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/79-global-template-button-strategy-360139.pdf (are there an example implementation?), or
    http://one-size-doesnt-fit-all.blogspot.dk/2010/11/adf-ui-shell-supporting-global-hotkeys.html
    in advance thanks
    Inspiration webpages
    https://blogs.oracle.com/jdevotnharvest/entry/how_to_programmatically_set_focus
    http://technology.amis.nl/2008/01/04/adf-11g-rich-faces-focus-on-field-after-button-press-or-ppr-including-javascript-in-ppr-response-and-clientlisteners-client-side-programming-in-adf-faces-rich-client-components-part-2/
    how to Commit table by writting Java code in Managed Bean?
    Table does not refresh and getting error as UIComponent is Null
    A short description of the solution:
    (jdeveloper version 11.1.1.2.0)
    --- Example where I use onSetFocus in jsff page
    <af:commandButton text="#{hrsusuiBundle.FOCUS}" id="cb10"
    partialSubmit="true" accessKey="f"
    shortDesc="Alt+Shift+F"
    actionListener="#{managedBean_clientUtils.onSetFocus}">
    <af:clientAttribute name="focusField" value="t1"/>
    </af:commandButton>
    --- Examples where I use doTableActionAndSetFocus in jsff page
    --- There have to be a binding in the jsff page to delete, commit and rollback
    <af:commandButton text="#{hrsusuiBundle.DELETE}" id="cb4"
    accessKey="x"
    shortDesc="Alt+Shift+X"
    partialSubmit="true"
    actionListener="#{managedBean_clientUtils.doTableActionAndSetFocus}">
    <af:clientAttribute name="focusField" value="t1"/>
    <af:clientAttribute name="actionField" value="Delete"/>
    </af:commandButton>
    <af:commandButton text="#{hrsusuiBundle.COMMIT}" id="cb5"
    accessKey="s" shortDesc="Alt+Shift+S"
    partialSubmit="true"
    actionListener="#{managedBean_clientUtils.doTableActionAndSetFocus}">
    <af:clientAttribute name="focusField" value="t1"/>
    <af:clientAttribute name="actionField" value="Commit"/>
    </af:commandButton>
    <af:commandButton text="#{hrsusuiBundle.ROLLBACK}" id="cb6"
    accessKey="z" shortDesc="Alt+Shift+Z"
    partialSubmit="true"
    actionListener="#{managedBean_clientUtils.doTableActionAndSetFocus}"
    immediate="true">
    <af:resetActionListener/>
    <af:clientAttribute name="focusField" value="t1"/>
    <af:clientAttribute name="actionField" value="Rollback"/>
    </af:commandButton>
    --- This is the java class I use
    --- It is published in adfc-config.xml as a request scope managedbean
    public class ClientUtils {
    public ClientUtils() {
    public void doTableActionAndSetFocus(ActionEvent event) {
    RichCommandButton rcb = (RichCommandButton)event.getSource();
    String focusOn = (String)rcb.getAttributes().get("focusField");
    String actionToDo = (String)rcb.getAttributes().get("actionField");
    UIComponent component = null;
    String clientId = null;
    component = JSFUtils.findComponentInRoot(focusOn);
    clientId = component.getClientId(JSFUtils.getFacesContext());
    if ( "Delete".equals(actionToDo) || "Commit".equals(actionToDo) || "Rollback".equals(actionToDo) ){
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    OperationBinding operationBinding = bindings.getOperationBinding(actionToDo);
    Object result = operationBinding.execute();
    AdfFacesContext.getCurrentInstance().addPartialTarget(component);
    if (clientId != null) {           
    makeSetFocusJavaScript(clientId);
    public static String onSetFocus(ActionEvent event) {
    RichCommandButton rcb = (RichCommandButton)event.getSource();
    String focusOn = (String)rcb.getAttributes().get("focusField");
    String clientId = null;
    if (focusOn.contains(":")) {
    clientId = focusOn;
    } else {
    clientId = findComponentsClientIdInRoot(focusOn);
    if (clientId != null) {           
    makeSetFocusJavaScript(clientId);
    return null;
    private static void writeJavaScriptToClient(String script) {
    FacesContext fctx = FacesContext.getCurrentInstance();
    ExtendedRenderKitService erks = null;
    erks = Service.getRenderKitService(fctx, ExtendedRenderKitService.class);
    erks.addScript(fctx, script);
    public static void makeSetFocusJavaScript(String clientId) {
    if (clientId != null) {
    StringBuilder script = new StringBuilder();
    //use client id to ensure component is found if located in
    //naming container
    script.append("var textInput = ");
    script.append("AdfPage.PAGE.findComponentByAbsoluteId");
    script.append ("('"+clientId+"');");
    script.append("if(textInput != null){");
    script.append("textInput.focus();");
    script.append("}");
    writeJavaScriptToClient(script.toString());
    public static String findComponentsClientIdInRoot(String id) {
    UIComponent component = null;
    String clientId = null;
    component = JSFUtils.findComponentInRoot(id);
    clientId = component.getClientId(JSFUtils.getFacesContext());
    return clientId;
    }

    Hi,
    I am developing an ADF application where the users do not want to use the mouse. So I would like to know if there are a best practice for this?
    Well HTML (and this is the user interface you see) follows a tab index navigation that you follow with "tab" and "shift+tab". Anything else is a short cut for which you use mnemonics (as you already do) or shortcuts (explained in http://one-size-doesnt-fit-all.blogspot.dk/2010/11/adf-ui-shell-supporting-global-hotkeys.html). There is a distinction to make between non-web environments (which I think you and your users have abackground in) and client desktop environments. Browsers block some keyboard functionality for their own purpose. So you may have to find a list of keys first that work across browsers. Unlike desktop clients, which allow you to "press a button" without the button to take focus, this cannot be done on the web. So you need to be clever here, avoiding buttons at all.
    The following paper is about JavaScript in ADF and explains the basics for what Chris Muir explains in : http://one-size-doesnt-fit-all.blogspot.dk/2010/11/adf-ui-shell-supporting-global-hotkeys.html
    http://www.oracle.com/technetwork/developer-tools/jdev/1-2011-javascript-302460.pdf
    It has the outline for how to register short cut keys that perform a specific action (e.g. register ctrl+d to delete the current row you are on, or press F11 to execute a query (similar to Oracle Forms frmres files)). However, be aware that this includes some code you have to write (actually quite some code to be honest).
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/79-global-template-button-strategy-360139.pdf (are there an example implementation?), or
    http://one-size-doesnt-fit-all.blogspot.dk/2010/11/adf-ui-shell-supporting-global-hotkeys.html
    Actually these are implementations as they come with example code for you to use and customize, do they? So what is this question asking for more ? Also note that global buttons don't quite have anything in common with the question you asked. I assume you want to see it as an implementation of the Forms toolbar that operates on the form or table the focus is in. This however does not work for the web as there is nothing that keeps track of which component has a focus and to what iterator (data block) it belongs. This would involve even more coding (though possibly doable)
    Frank

  • How to disable html for whole swing application.

    Hi,
    As we can disable html for individual swing components , for example JLabel
    label.putClientProperty("html.disable",Boolean.TRUE);
    BasicHTML.updateRenderer(label,"html.disable");
    is there any way to disable html rendering in swing components for system wide / whole application?.
    Thanks
    Kiran

    Better use a utility method in the application like this
    public static void disableHtml(JComponent component)
    component.putClientProperty("html.disable",Boolean.TRUE);
    BasicHTML.updateRenderer(component,"html.disable");
    call disableHtml(Component u want to set html disable) for any component in the application.

  • Best place for S60 v5 Applications?

    I assume the best place for applications for my 5800 (or any other device) WILL BE the Ovi store.
    But until it launches, where have we found to be the best place to get reliable apps?

    have a look here there is lots of great apps here free and themes and games enjoy
    http://dailymobile.se/
    If  i have helped at all a click on the white star below would be nice thanks.
    Now using the Lumia 1520

Maybe you are looking for

  • How do I find and destroy malware on my MacBook Pro?

    I Noticed pop ups happening on Netflix, googled it, got malware as an answer. How do I fix this? I have a MacBook pro from like three years ago, runnin 10.6.8 on it. Help? Easy, tried and true help. Will upgrading to maverick solve my problem? Like a

  • How to set property for Cluster Environment for JMS Adapter

    Hi All, I am moving from DEV to Prod environment which is cluster. Can you Please explain me what property I need to Set for Cluster Environment for JMS Adapter, so that I could avoid race condition for Dequeue/enqueue. I am using soa suite 10.1..3.4

  • TS1424 Incomplete downloads from itunes store

    I purchased songs in the itunes store, but the entire song did not download.  I need the full song dowloaded.  How do I correct this?  When I redownload songs purchased, it downloads the same incomplete song!

  • Re-downloading purchased music from itunes

    I went to download past purchases and it shows they have already been downloaded on my computer (mac mini) which I am sure they were -- I think my daughter deleted them by mistake.  How do I re-download them through iTunes.  They show up as "download

  • Display problem dragging windows

    When I drag a window across the screen it leaves ghost images behind. See the attached image. This problem just started recently with no apparent cause. This is a 13" MacBook Pro running OSX 10.6.8   Model Identifier: MacBookPro8,1   Processor Name: