Centering a JLabel in an application

Excuse me for being a noob, but it is really annoying me:
I just started with Java and wanted to create something simple and i though; what could be more simple than a program which displays your current IP and hostname. I got everything working exept the fact that i'm having trouble centering the JLabels containing the results on the screen. I was hoping someone could help me with this.
Many thanks in advance

import javax.swing.*;
public class Test {
    public static void main(String[] args) {
        JLabel label = new JLabel("text", SwingConstants.CENTER);
        final JFrame f = new JFrame("Test");
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.getContentPane().add(label);
        f.setSize(400, 50);
        SwingUtilities.invokeLater(new Runnable(){
            public void run() {
                f.setLocationRelativeTo(null);
                f.setVisible(true);
}There is a whole forum devoted to Swing, by the way...

Similar Messages

  • Centering a JLabel in a Box

    Hi,
    I'm having trouble centering a JLabel that has been added to a Vertical Box. Does anyone know an easy way to center the label?
    Thanks
    Jim

    import javax.swing.*;
    public class Test {
        public static void main(String[] args) {
            JLabel label = new JLabel("text", SwingConstants.CENTER);
            final JFrame f = new JFrame("Test");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(label);
            f.setSize(400, 50);
            SwingUtilities.invokeLater(new Runnable(){
                public void run() {
                    f.setLocationRelativeTo(null);
                    f.setVisible(true);
    }There is a whole forum devoted to Swing, by the way...

  • Centering a fixed size air application when maximized

    I have a fixed-sized air application that when maximized I want it to be centered on the user's screen. Currently when it is maximized it goes to the top left corner of the screen. Is there any way I can make this centered?

    Hi,
    The issue is because you are using fixed height, width and absolute positioning. I have introduced a Canvas as an outer container
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" height="700" width="768"
        paddingLeft="5" paddingRight="5" paddingTop="5" paddingBottom="5"
         alpha="1.0" borderColor="#FFFFFF"
         xmlns:components="com.components.*"
        applicationComplete="init()" xmlns:views="views.*" verticalScrollPolicy="off" horizontalScrollPolicy="off" showStatusBar="false">
    <mx:Canvas height="700" width="768" verticalCenter="0" horizontalCenter="0">
        <components:Header id="header" x="0" y="0" width="768"/>
        <mx:ViewStack id="mainViewStack" selectedIndex="{ApplicationModel.instance.viewState}" x="2" y="52" height="608">
            <views:LessonView x="0" y="50" height="608" id="mainLessonView" creationPolicy="queued" creationIndex="1" />
            <views:ChooseLessonsView x="0" y="50" height="608" id="mainChooseLessonView" />
            <views:HelpView x="0" y="50" id="mainHelpView" creationPolicy="queued" creationIndex="2" height="608"/>
            <views:FAQView x="0" y="50" id="mainFAQView" creationIndex="5" creationPolicy="queued" height="608"/>   
            <views:LoginView x="0" y="50" id="mainLoginView" creationPolicy="queued" creationIndex="4"  height="608"/>
        </mx:ViewStack>
        <components:Footer height="40" x="0" y="660" width="768"/>
    </mx:Canvas>     
    </mx:WindowedApplication>

  • Java Bug? Centering a JLable with just an icon in a JScrollPane

    Hi,
    I'm attempting to write a image viewing program. I would like the image centered on the window displaying them, but because some images are larger than the window, I would like the image to be in the upper left hand coner of the window with scroll bars to allow you to view the rest of the image.
    I have attempted to implement this by placing a JScrollPane on a JFrame, and then placing a JLabel in the JScrollPane's Viewport. I set the Label's text to blank, and then set the image, wraped in an InageIcon, as the JLabel's Icon.
    To center the JLabel, I have tried to set the JScrollPane's Viewport's LayoutManager to two different layout managers, but I've found buggy operation with each. The Layout I've tried are the following:
    1. a GridLayout(1,1,0,0); - this works fine when the image is smaller that the available area of the JScrollPane. However, if the window is resized so that the image more than totally fills the JScrollPane, the image gets cut off. What happens is that the image is centered in the available scrollpane view, meaning the uper and left edges of the image get cut off. Scroll bars appear to let you view the lower and righer edges of the image, however, when you scroll, the newly uncovered areas of the image never get drawn, so you can't get to see the lower or right edges of the image either.
    2. a GridbagLayout with one row, and one column each with a weight of 100, centered and told to fill both horizontally and vertically. Again, this correctly centers the JLabel when th eimage is smaler than the available space in the JScrollPane. Once the window is resized so that the image is bigger than the space to view the image in, strange problems occur. This time it seems that the JScrollPane's scrollbars show that there should be enough room to show the image if the image was in the upper left corner, however, the image isn't in the upper left corner, it is offset down and to the right if the upper left corner by an amount that appears equal to the amount of extra space needed to display the image. For example, if the image is 200x300 and the view area is 150x200, ite image is offest by 50 horizontally and 100 vertically. This results in the bottom and right edges of the image getting cut off because the scrollbars only scroll far enough to show the image if the image was placed at 0,0 and not at the offset location that it is placed at.
    You may not understand what I'm trying to say from my description, but below is code that can reproduce the problem.
    Questions. Am I doing anything wrong that is causing this problem? Is that another, better way to center the JLabel that doesn't have these problems? Is this a JAVA Bug in either the layoutmanagers, JScrollPane or JLabel when it only contains an icon and no text?
    Code:
    this is the class that creates and lays out the JFrame. It currently generates a 256x256 pixel image. By changing the imagesize variable to 512, you can get a larger image to work with which will make the bug more obvious.
    When first run the application will show what happens when using the GridLayout and described in 1. There are two commented out lines just below the GridLayout code that use a GridbagLayout as descriped in method 2. Comment out the GridLayout code when you uncomment the GridBageLayout code.
    package centertest;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.image.*;
    public class Frame1 extends JFrame {
        JPanel contentPane;
        BorderLayout borderLayout1 = new BorderLayout();
        JScrollPane jScrollPane1 = new JScrollPane();
        JLabel jLabel1 = new JLabel();
        static final int imagesize=256;
        //Construct the frame
        public Frame1() {
            enableEvents(AWTEvent.WINDOW_EVENT_MASK);
            try {
                jbInit();
            catch(Exception e) {
                e.printStackTrace();
        //Component initialization
        private void jbInit() throws Exception  {
            contentPane = (JPanel) this.getContentPane();
            contentPane.setLayout(borderLayout1);
            this.setSize(new Dimension(400, 300));
            this.setTitle("Frame Title");
            //setup label
            jLabel1.setIconTextGap(0);
            jLabel1.setHorizontalAlignment(JLabel.CENTER);
            jLabel1.setVerticalAlignment(JLabel.CENTER);
            jLabel1.setVerticalTextPosition(JLabel.BOTTOM);
            //create image and add it to the label as an icon
            int[] pixels = new int[imagesize*imagesize];
            for(int i=0;i<pixels.length;i++){
                pixels=i|(0xff<<24);
    MemoryImageSource mis = new MemoryImageSource(imagesize, imagesize,
    pixels, 0, imagesize);
    Image img = createImage(mis);
    jLabel1.setIcon(new ImageIcon(img));
    jLabel1.setText("");
    contentPane.add(jScrollPane1, BorderLayout.CENTER);
    //center image using a GridLayout
    jScrollPane1.getViewport().setLayout(new GridLayout(1,1,0,0));
    jScrollPane1.getViewport().add(jLabel1);
    //Center the image using a GridBagLayout
    /*jScrollPane1.getViewport().setLayout(new GridBagLayout());
    jScrollPane1.getViewport().add(jLabel1,
    new GridBagConstraints(0, 0, 1, 1, 100.0, 100.0,
    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    new Insets(0, 0, 0, 0), 0, 0));
    //Overridden so we can exit when window is closed
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    System.exit(0);
    and here is an application with which to launch the frame
    package centertest;
    import javax.swing.UIManager;
    import java.awt.*;
    public class Application1 {
        boolean packFrame = false;
        //Construct the application
        public Application1() {
            Frame1 frame = new Frame1();
            //Validate frames that have preset sizes
            //Pack frames that have useful preferred size info, e.g. from their layout
            if (packFrame) {
                frame.pack();
            else {
                frame.validate();
            //Center the window
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            Dimension frameSize = frame.getSize();
            if (frameSize.height > screenSize.height) {
                frameSize.height = screenSize.height;
            if (frameSize.width > screenSize.width) {
                frameSize.width = screenSize.width;
            frame.setLocation( (screenSize.width - frameSize.width) / 2,
                              (screenSize.height - frameSize.height) / 2);
            frame.setVisible(true);
        //Main method
        public static void main(String[] args) {
            try {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            catch (Exception e) {
                e.printStackTrace();
            new Application1();
    }I'm running Java 1.4.1 build 21 on Windows 98. I used JBuilder8 Personal to write this code.

    Hmmm,
    You are correct. Not setting a layout for the scrollpane's viewport (using the default of javax.swing.ViewportLayout) results in the positioning of the image tat I want (center the image if image is smaller than the scrollpane, if the image is larger, place it in the upper-left corener and enable the scrollbars to scroll to see the rest of the image).
    Anyone have any idea why the GridLayout and GridBagLayout act as they do? I gues it isn't that important tomy program, but I'm still not sure that they are operating correctly. (Specifically, GridLayout sha scrollbars, but when you scroll, no new parts of the image are revealed.)

  • Centering an Alert box.

    I have a flex web application in which the flex components are embedded inside portal jsps. When the user clicks on a datagrid (clicks on item renderer inside the datagrid), the Alert box has to notify the user. However the alert box centers itself wrt the flex application and it goes out of the user's view. Because the user can view only a portion of the large datagrid at a particular time (scrollbars for the page are present, not for the datagrid).
    I have tried assigning absolute and relative values, but nothing seems to work.
    Any suggestions woudl be greatly appreaciated.
    Thanks in advance.

    I've run into a similar situation and here is what I did to resolve it without using the move method...
    Say you have an application that has a layout container which contains a custom component in it somewhere
    Application
           |--->HGroup
                        |---> CustomComponent (the one that calls the alert box)
    if your alert box code looks like this:
    Alert.show(
    "Your Alert Message Here!","Your Alert Title Here...",0x4,this,null,null);
    Your alert box will appear centered over the custom component which called it.
    Add an id to the container you want the alert box centered on:
    Application
           |--->HGroup id="myContainer"
                        |---> CustomComponent (the one that calls the alert box)
    Change your alert box code to look like this:
    Alert.show(
    "Your Alert Message Here!","Your Alert Title Here...",0x4,this.parentApplication.myContainer,null,null);
    This will center the alert box over the HGroup layout container that has its id property set to myContainer.
    The example above sets the parent property of of the Alert class show method:
    public static function show(text:String = "", title:String = "", flags:uint = 0x4, parent:Sprite = null, closeHandler:Function = null, iconClass:Class = null, defaultButtonFlag:uint = 0x4):Alert
    So if I'm understanding your issue correctly... regardless of the size of your viewport you'll maybe want a dynamic method to determine the id porperty of the layout container currently being displayed within the viewport, and then center your alert box over that container via the method above.
    I hope this helps.

  • Setting Text over an Icon which is on a JLabel - Urgent

    Can someone help me. I need to set some text over an Image/Icon which is placed over a JLabel.

    You should simply change the iconTextGap value (according to the string width and the icon width if you want it centered) :
              JFrame frame = new JFrame("Centered label");
              JLabel label = new JLabel("centered label",new ImageIcon("im1.gif"),SwingConstants.LEFT);
              frame.getContentPane().add(label, BorderLayout.CENTER);
              frame.pack();
              frame.setVisible(true);
              int iconWidth = label.getIcon().getIconWidth();
              Font font = label.getFont();
              Graphics g = label.getGraphics();
              FontMetrics fm = g.getFontMetrics();
              int stringWidth = fm.stringWidth(label.getText());
              label.setIconTextGap(-stringWidth+((stringWidth-iconWidth)/2) );
    I have made the frame visible before setting the texticongap because you can't get the graphic context of a component if this component is invisible.
    Now the label is perfectly centered on the icon.
    I hope this helps,
    Denis

  • Status bar or jlabel

    hi all,
    how can i create a status bar on my java app
    that shows a message if it is connected on the internet or not.
    i already have an application that checks for internet connection
    every 6seconds, and has a getter method that returns a
    message.
    also is this possible?
    JLabel.setText(CheckConnection.getMessage())
    where CheckConnection.getMessage() returns a String value.
    how can i make my JLabel act like it was refreshing when the string passed to it changed?
    so that my JLabel notifies my application that it is disconnected.
    thanks.

    Hi,
    Create a thread that calls checkConnection.getMessage(), and sets the message on the JLabel.
    Kaj

  • JLabel LAF in J2SDK1.4.1

    Hello.
    With the precedents JVM, the JLabels of my application were blue.
    Now with the 1.4.1 they appear black.
    I suppose there are modifications in default LAF.
    Does any of you know how I can do to keep the previous appearance ?
    Thanks in advance

    Use this code in the application to change the fore ground color of all the labels in the application. Use it before u make anything visible.
    try {
        //use the color of your choice
        ColorUIResource color = new ColorUIResource(Color.white);
        UIManager.put("Label.foreground", color);
    } catch(Exception e) {
        System.out.println(e);

  • Align ImageIcon on JLabel

    Hi,
    I use an ImageIcon on a JLabel, which is embedded in a ScrollPane, which is embedded in a SplitPane. When I now resize the window or the SplitPane-side, the image is always centered on JLabel. But I want it to be in the upper left corner, since I have to assure that the upper left corner of the image is at (0,0). Otherwise other painting would move relative to the image.
    I tried
    setHorizontalAlignment(SwingConstants.RIGHT);
    setVerticalAlignment(SwingConstants.TOP);
    on JLabel, but only the latter had the proper effect. The former seems to be ignored. Is this a bug? How to work around?
    I use jdk v1.3.1_01 on Linux.
    Thanks for any help.
    Greets
    Puce

    You should embed your JLabel in a container with a flow layout with a left alignment:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class ImageScrollPane extends JFrame {
         ImageScrollPane() {
              super("");
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              setBounds(100,100,685,513);
              Container c = new Container();
              c.setLayout(new FlowLayout(FlowLayout.LEFT,0,0));
              c.add(new JLabel(new ImageIcon("im.jpg")));
              JScrollPane scroller = new JScrollPane(c);
              getContentPane().add(scroller);
              pack();
              setVisible(true);
         public static void main(String[] args) {
              new ImageScrollPane();
    }I hope this helps,
    Denis

  • Application Server are down

    Hi,
    We have installed our ECQ system on MSCS cluster. We have installed all the different SAP instances on different server such as
    Database Instance, Centeral Instance, Applicaiton I instance, Application 2 instance. After the install, we were able to bring up the database, centeral instance and only one application instance up simaltanously. Howevever, we can't bring up the 2nd application instance up. When ever we bring up the second application instance up, the first one dies. When we bring up the first one, the second one dies. Now, I am dispatcher and Server process for the Java engine for Central instance not coming up any more. I have attached the logs for the dispatcher of the JAVA for Central Instance. After that, i need to figure out how to bring up both of the application server (JAVA+ABAP) stack. Below is the dispatcher developre trace for Java of Central instance.
    trc file: "E:\usr\sap\ECQ\DVEBMGS00\work\dev_dispatcher", trc level: 1, release: "700"
    node name   : ID3638900
    pid         : 7140
    system name : ECQ
    system nr.  : 00
    started at  : Fri Oct 16 10:19:13 2009
    arguments       :
           arg[00] : E:\usr\sap\ECQ\DVEBMGS00\exe\jlaunch.exe
           arg[01] : pf=
    ECQA-DB\sapmnt\ECQ\SYS\profile\ECQ_DVEBMGS00_ECCECQ-CIS
           arg[02] : -DSAPINFO=ECQ_00_dispatcher
           arg[03] : pf=
    ECQA-DB\sapmnt\ECQ\SYS\profile\ECQ_DVEBMGS00_ECCECQ-CIS
           arg[04] : -DSAPSTART=1
           arg[05] : -DCONNECT_PORT=4202
           arg[06] : -DSAPSYSTEM=00
           arg[07] : -DSAPSYSTEMNAME=ECQ
           arg[08] : -DSAPMYNAME=ECCECQ-CIS_ECQ_00
           arg[09] : -DSAPPROFILE=
    ECQA-DB\sapmnt\ECQ\SYS\profile\ECQ_DVEBMGS00_ECCECQ-CIS
           arg[10] : -DFRFC_FALLBACK=ON
           arg[11] : -DFRFC_FALLBACK_HOST=localhost
    [Thr 7428] Fri Oct 16 10:19:13 2009
    [Thr 7428] *** WARNING => INFO: Unknown property [instance.box.number=ECQDVEBMGS00eccecq-cis] [jstartxx.c   841]
    [Thr 7428] *** WARNING => INFO: Unknown property [instance.en.host=ECQA-DB] [jstartxx.c   841]
    [Thr 7428] *** WARNING => INFO: Unknown property [instance.en.port=3201] [jstartxx.c   841]
    [Thr 7428] *** WARNING => INFO: Unknown property [instance.system.id=0] [jstartxx.c   841]
    JStartupReadInstanceProperties: read instance properties [E:\usr\sap\ECQ\DVEBMGS00\j2ee\cluster\instance.properties]
    -> ms host    : ECQA-DB
    -> ms port    : 3901
    -> OS libs    : E:\usr\sap\ECQ\DVEBMGS00\j2ee\os_libs
    -> Admin URL  :
    -> run mode   : normal
    -> run action : NONE
    -> enabled    : yes
    Used property files
    -> files [00] : E:\usr\sap\ECQ\DVEBMGS00\j2ee\cluster\instance.properties
    Instance properties
    -> ms host    : ECQA-DB
    -> ms port    : 3901
    -> os libs    : E:\usr\sap\ECQ\DVEBMGS00\j2ee\os_libs
    -> admin URL  :
    -> run mode   : normal
    -> run action : NONE
    -> enabled    : yes
    Bootstrap nodes
    -> [00] bootstrap            : E:\usr\sap\ECQ\DVEBMGS00\j2ee\cluster\instance.properties
    -> [01] bootstrap_ID3638900  : E:\usr\sap\ECQ\DVEBMGS00\j2ee\cluster\instance.properties
    -> [02] bootstrap_ID3638950  : E:\usr\sap\ECQ\DVEBMGS00\j2ee\cluster\instance.properties
    Worker nodes
    -> [00] ID3638900            : E:\usr\sap\ECQ\DVEBMGS00\j2ee\cluster\instance.properties
    -> [01] ID3638950            : E:\usr\sap\ECQ\DVEBMGS00\j2ee\cluster\instance.properties
    [Thr 7428] JLaunchRequestQueueInit: create named pipe for ipc
    [Thr 7428] JLaunchRequestQueueInit: create pipe listener thread
    [Thr 6176] JLaunchRequestFunc: Thread 6176 started as listener thread for np messages.
    [Thr 6536] WaitSyncSemThread: Thread 6536 started as semaphore monitor thread.
    [Thr 7428] NiInit3: NI already initialized; param 'maxHandles' ignored (1;202)
    [Thr 7428] CPIC (version=700.2006.09.13)
    [Thr 7428] [Node: dispatcher] java home is set by profile parameter
         Java Home: C:\j2sdk1.4.2_18-x64
    [Thr 7428] JStartupICheckFrameworkPackage: can't find framework package E:\usr\sap\ECQ\DVEBMGS00\exe\jvmx.jar
    JStartupIReadSection: read node properties [ID3638900]
    -> node name          : dispatcher
    -> node type          : dispatcher
    -> node execute       : yes
    -> jlaunch parameters :
    -> java path          : C:\j2sdk1.4.2_18-x64
    -> java parameters    : -XX:NewSize=57M -XX:MaxNewSize=57M -XX:+DisableExplicitGC -verbose:gc -Djava.security.policy=.java.policy -Djava.security.egd=file:/dev/urandom -Djco.jarm=1
    -> java vm version    : 1.4.2_18-b06
    -> java vm vendor     : Java HotSpot(TM) 64-Bit Server VM (Sun Microsystems Inc.)
    -> java vm type       : server
    -> java vm cpu        : amd64
    -> heap size          : 170M
    -> init heap size     : 170M
    -> root path          : E:\usr\sap\ECQ\DVEBMGS00\j2ee\cluster\dispatcher
    -> class path         : .\bin\boot\boot.jar;.\bin\system\bytecode.jar;.
    -> OS libs path       : E:\usr\sap\ECQ\DVEBMGS00\j2ee\os_libs
    -> main class         : com.sap.engine.boot.Start
    -> framework class    : com.sap.bc.proj.jstartup.JStartupFramework
    -> registr. class     : com.sap.bc.proj.jstartup.JStartupNatives
    -> framework path     : E:\usr\sap\ECQ\DVEBMGS00\exe\jstartup.jar;E:\usr\sap\ECQ\DVEBMGS00\exe\jvmx.jar
    -> shutdown class     : com.sap.engine.boot.Start
    -> parameters         :
    -> debuggable         : no
    -> debug mode         : no
    -> debug port         : 50000
    -> shutdown timeout   : 120000
    [Thr 7428] JLaunchISetDebugMode: set debug mode [no]
    [Thr 8264] JLaunchIStartFunc: Thread 8264 started as Java VM thread.
    [Thr 8264] [JHVM_PrepareVMOptions] use java parameters set by profile parameter
         Java Parameters: -Xss2m
    JHVM_LoadJavaVM: VM Arguments of node [dispatcher]
    -> stack   : 1048576 Bytes
    -> arg[  0]: exit
    -> arg[  1]: abort
    -> arg[  2]: vfprintf
    -> arg[  3]: -XX:NewSize=57M
    -> arg[  4]: -XX:MaxNewSize=57M
    -> arg[  5]: -XX:+DisableExplicitGC
    -> arg[  6]: -verbose:gc
    -> arg[  7]: -Djava.security.policy=.java.policy
    -> arg[  8]: -Djava.security.egd=file:/dev/urandom
    -> arg[  9]: -Djco.jarm=1
    -> arg[ 10]: -Dsys.global.dir=
    ECQA-DB\sapmnt\ECQ\SYS\global
    -> arg[ 11]: -Dapplication.home=E:\usr\sap\ECQ\DVEBMGS00\exe
    -> arg[ 12]: -Djava.class.path=E:\usr\sap\ECQ\DVEBMGS00\exe\jstartup.jar;E:\usr\sap\ECQ\DVEBMGS00\exe\jvmx.jar;.\bin\boot\boot.jar;.\bin\system\bytecode.jar;.
    -> arg[ 13]: -Djava.library.path=C:\j2sdk1.4.2_18-x64\jre\bin\server;C:\j2sdk1.4.2_18-x64\jre\bin;C:\j2sdk1.4.2_18-x64\bin;E:\usr\sap\ECQ\DVEBMGS00\j2ee\os_libs;C:\Program Files (x86)\EMC\PowerPath\;C:\Program Files\HP\NCU;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;
    ECQA-DB\sapmnt\ECQ\SYS\exe\uc\NTAMD64
    -> arg[ 14]: -Dmemory.manager=170M
    -> arg[ 15]: -Xmx170M
    -> arg[ 16]: -Xms170M
    -> arg[ 17]: -DLoadBalanceRestricted=no
    -> arg[ 18]: -Djstartup.mode=JCONTROL
    -> arg[ 19]: -Djstartup.ownProcessId=7140
    -> arg[ 20]: -Djstartup.ownHardwareId=Z0120251026
    -> arg[ 21]: -Djstartup.whoami=dispatcher
    -> arg[ 22]: -Djstartup.debuggable=no
    -> arg[ 23]: -Xss2m
    -> arg[ 24]: -DSAPINFO=ECQ_00_dispatcher
    -> arg[ 25]: -DSAPSTART=1
    -> arg[ 26]: -DCONNECT_PORT=4202
    -> arg[ 27]: -DSAPSYSTEM=00
    -> arg[ 28]: -DSAPSYSTEMNAME=ECQ
    -> arg[ 29]: -DSAPMYNAME=ECCECQ-CIS_ECQ_00
    -> arg[ 30]: -DSAPPROFILE=
    ECQA-DB\sapmnt\ECQ\SYS\profile\ECQ_DVEBMGS00_ECCECQ-CIS
    -> arg[ 31]: -DFRFC_FALLBACK=ON
    -> arg[ 32]: -DFRFC_FALLBACK_HOST=localhost
    -> arg[ 33]: -DSAPSTARTUP=1
    -> arg[ 34]: -DSAPSYSTEM=00
    -> arg[ 35]: -DSAPSYSTEMNAME=ECQ
    -> arg[ 36]: -DSAPMYNAME=ECCECQ-CIS_ECQ_00
    -> arg[ 37]: -DSAPDBHOST=ECQA-DB
    -> arg[ 38]: -Dj2ee.dbhost=ECQA-DB
    "SAPEngine_System_Thread[impl:6]_2" prio=5 tid=0x000000000696e340 nid=0x1580 in Object.wait() [0x000000000762f000..0x000000000762fb80]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x00000000139104b8> (a com.sap.engine.lib.util.WaitQueue)
         at java.lang.Object.wait(Object.java:429)
         at com.sap.engine.lib.util.WaitQueue.dequeue(WaitQueue.java:238)
         - locked <0x00000000139104b8> (a com.sap.engine.lib.util.WaitQueue)
         at com.sap.engine.core.thread.impl6.SingleThread.run(SingleThread.java:131)
    "SAP J2EE Engine|MS Socket Listener" prio=5 tid=0x000000000696e0b0 nid=0x4c8 runnable [0x000000000742f000..0x000000000742fb80]
         at java.net.SocketInputStream.socketRead0(Native Method)
         at java.net.SocketInputStream.read(SocketInputStream.java:129)
         at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
         at java.io.BufferedInputStream.read1(BufferedInputStream.java:222)
         at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
         - locked <0x0000000013913928> (a java.io.BufferedInputStream)
         at com.sap.engine.core.cluster.impl6.ms.MSMessageHeader.read(MSMessageHeader.java:440)
         at com.sap.engine.core.cluster.impl6.ms.MSMessageObjectImpl.readHeader(MSMessageObjectImpl.java:142)
         at com.sap.engine.core.cluster.impl6.ms.MSRawConnection.receiveRawMessage(MSRawConnection.java:1674)
         at com.sap.engine.core.cluster.impl6.ms.MSListener.run(MSListener.java:86)
         at com.sap.engine.frame.core.thread.Task.run(Task.java:64)
         at com.sap.engine.core.thread.impl6.SingleThread.execute(SingleThread.java:82)
         at com.sap.engine.core.thread.impl6.SingleThread.run(SingleThread.java:154)
    "SAP J2EE Engine|MS Queue Listener" prio=5 tid=0x0000000001701bc0 nid=0x1410 in Object.wait() [0x000000000722f000..0x000000000722fb80]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x0000000013913c28> (a com.sap.engine.lib.util.WaitQueue)
         at java.lang.Object.wait(Object.java:429)
         at com.sap.engine.lib.util.WaitQueue.dequeue(WaitQueue.java:192)
         - locked <0x0000000013913c28> (a com.sap.engine.lib.util.WaitQueue)
         at com.sap.engine.core.cluster.impl6.ms.MSListenerQueue.run(MSListenerQueue.java:67)
         at com.sap.engine.frame.core.thread.Task.run(Task.java:64)
         at com.sap.engine.core.thread.impl6.SingleThread.execute(SingleThread.java:82)
         at com.sap.engine.core.thread.impl6.SingleThread.run(SingleThread.java:154)
    "Thread-1" prio=5 tid=0x0000000001701410 nid=0x20b8 runnable [0x000000000680e000..0x000000000680fb80]
         at java.io.BufferedWriter.ensureOpen(BufferedWriter.java:97)
         at java.io.BufferedWriter.write(BufferedWriter.java:197)
         - locked <0x000000001398c0e8> (a java.io.OutputStreamWriter)
         at java.io.Writer.write(Writer.java:126)
         at java.io.PrintStream.write(PrintStream.java:303)
         - locked <0x0000000013960c90> (a com.sap.engine.system.SystemEnvironment$ConstantPrintStream)
         at java.io.PrintStream.print(PrintStream.java:448)
         at java.io.PrintStream.println(PrintStream.java:585)
         - locked <0x0000000013960c90> (a com.sap.engine.system.SystemEnvironment$ConstantPrintStream)
         at com.sap.engine.core.service630.container.MemoryContainer.startServices(MemoryContainer.java:237)
         - locked <0x0000000012db5728> (a com.sap.engine.core.service630.container.MemoryContainer)
         at com.sap.engine.core.service630.container.MemoryContainer.start(MemoryContainer.java:161)
         - locked <0x0000000012db5810> (a java.lang.Object)
         at com.sap.engine.core.service630.container.AbstractServiceContainer.init(AbstractServiceContainer.java:111)
         at com.sap.engine.core.Framework.loadSingleManager(Framework.java:576)
         at com.sap.engine.core.Framework.loadManagers(Framework.java:254)
         at com.sap.engine.core.Framework.start(Framework.java:188)
         - locked <0x0000000013913d58> (a com.sap.engine.core.Framework)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.boot.FrameThread.run(FrameThread.java:61)
         at java.lang.Thread.run(Thread.java:534)
    "Signal Dispatcher" daemon prio=10 tid=0x00000000017009d0 nid=0x1830 waiting on condition [0x0000000000000000..0x0000000000000000]
    "Finalizer" daemon prio=9 tid=0x0000000001700740 nid=0x1534 in Object.wait() [0x0000000005f8f000..0x0000000005f8fb80]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x0000000013914470> (a java.lang.ref.ReferenceQueue$Lock)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
         - locked <0x0000000013914470> (a java.lang.ref.ReferenceQueue$Lock)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
         at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
    "Reference Handler" daemon prio=10 tid=0x0000000001700220 nid=0x610 in Object.wait() [0x0000000005d8f000..0x0000000005d8fb80]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x0000000013911390> (a java.lang.ref.Reference$Lock)
         at java.lang.Object.wait(Object.java:429)
         at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)
         - locked <0x0000000013911390> (a java.lang.ref.Reference$Lock)
    "main" prio=5 tid=0x00000000017004b0 nid=0x2048 in Object.wait() [0x000000000228f000..0x000000000228fc68]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x0000000013914518> (a com.sap.engine.boot.StartFrame)
         at java.lang.Object.wait(Object.java:429)
         at com.sap.engine.boot.StartFrame.work(StartFrame.java:121)
         - locked <0x0000000013914518> (a com.sap.engine.boot.StartFrame)
         at com.sap.engine.boot.Start.main(Start.java:34)
    "VM Thread" prio=5 tid=0x00000000012e9010 nid=0x1c74 runnable
    "VM Periodic Task Thread" prio=10 tid=0x00000000012e9210 nid=0x168 waiting on condition
    "Suspend Checker Thread" prio=10 tid=0x00000000012e9110 nid=0x2298 runnable
    [Thr 7284] Fri Oct 16 10:24:16 2009
    [Thr 7284] JLaunchIExitJava: exit hook is called (rc = -11114)
    [Thr 7284] **********************************************************************
    ERROR => The Java VM terminated with a non-zero exit code.
    Please see SAP Note 943602 , section 'J2EE Engine exit codes'
    for additional information and trouble shooting.
    [Thr 7284] JLaunchCloseProgram: good bye (exitcode = -11114)

    Anil,
    Attached are the logs for dev_bootstrap_id, std_bootstrap_id.out. iS there a way to attach logs in here?
    trc file: "E:\usr\sap\ECQ\DVEBMGS00\work\dev_bootstrap", trc level: 1, release: "700"
    node name   : bootstrap
    pid         : 5616
    system name : ECQ
    system nr.  : 00
    started at  : Fri Oct 16 14:08:59 2009
    arguments       :
           arg[00] : E:\usr\sap\ECQ\DVEBMGS00\exe\jlaunch.exe
           arg[01] : pf=
    ECQA-DB\sapmnt\ECQ\SYS\profile\ECQ_DVEBMGS00_ECCECQ-CIS
           arg[02] : -DSAPINFO=ECQ_00_bootstrap
           arg[03] : pf=
    ECQA-DB\sapmnt\ECQ\SYS\profile\ECQ_DVEBMGS00_ECCECQ-CIS
           arg[04] : -DSAPSTART=1
           arg[05] : -DCONNECT_PORT=3089
           arg[06] : -DSAPSYSTEM=00
           arg[07] : -DSAPSYSTEMNAME=ECQ
           arg[08] : -DSAPMYNAME=ECCECQ-CIS_ECQ_00
           arg[09] : -DSAPPROFILE=
    ECQA-DB\sapmnt\ECQ\SYS\profile\ECQ_DVEBMGS00_ECCECQ-CIS
           arg[10] : -DFRFC_FALLBACK=ON
           arg[11] : -DFRFC_FALLBACK_HOST=localhost
    [Thr 5344] Fri Oct 16 14:08:59 2009
    [Thr 5344] *** WARNING => INFO: Unknown property [instance.box.number=ECQDVEBMGS00eccecq-cis] [jstartxx.c   841]
    [Thr 5344] *** WARNING => INFO: Unknown property [instance.en.host=ECQA-DB] [jstartxx.c   841]
    [Thr 5344] *** WARNING => INFO: Unknown property [instance.en.port=3201] [jstartxx.c   841]
    [Thr 5344] *** WARNING => INFO: Unknown property [instance.system.id=0] [jstartxx.c   841]
    JStartupReadInstanceProperties: read instance properties [E:\usr\sap\ECQ\DVEBMGS00\j2ee\cluster\instance.properties]
    -> ms host    : ECQA-DB
    -> ms port    : 3901
    -> OS libs    : E:\usr\sap\ECQ\DVEBMGS00\j2ee\os_libs
    -> Admin URL  :
    -> run mode   : normal
    -> run action : NONE
    -> enabled    : yes
    Used property files
    -> files [00] : E:\usr\sap\ECQ\DVEBMGS00\j2ee\cluster\instance.properties
    Instance properties
    -> ms host    : ECQA-DB
    -> ms port    : 3901
    -> os libs    : E:\usr\sap\ECQ\DVEBMGS00\j2ee\os_libs
    -> admin URL  :
    -> run mode   : normal
    -> run action : NONE
    -> enabled    : yes
    Bootstrap nodes
    -> [00] bootstrap            : E:\usr\sap\ECQ\DVEBMGS00\j2ee\cluster\instance.properties
    -> [01] bootstrap_ID3638900  : E:\usr\sap\ECQ\DVEBMGS00\j2ee\cluster\instance.properties
    -> [02] bootstrap_ID3638950  : E:\usr\sap\ECQ\DVEBMGS00\j2ee\cluster\instance.properties
    Worker nodes
    -> [00] ID3638900            : E:\usr\sap\ECQ\DVEBMGS00\j2ee\cluster\instance.properties
    -> [01] ID3638950            : E:\usr\sap\ECQ\DVEBMGS00\j2ee\cluster\instance.properties
    [Thr 5344] JLaunchRequestQueueInit: create named pipe for ipc
    [Thr 5344] JLaunchRequestQueueInit: create pipe listener thread
    [Thr 2508] JLaunchRequestFunc: Thread 2508 started as listener thread for np messages.
    [Thr 3460] WaitSyncSemThread: Thread 3460 started as semaphore monitor thread.
    [Thr 5344] NiInit3: NI already initialized; param 'maxHandles' ignored (1;202)
    [Thr 5344] CPIC (version=700.2006.09.13)
    [Thr 5344] [Node: bootstrap] java home is set by profile parameter
         Java Home: C:\j2sdk1.4.2_18-x64
    [Thr 5344] JStartupICheckFrameworkPackage: can't find framework package E:\usr\sap\ECQ\DVEBMGS00\exe\jvmx.jar
    JStartupIReadSection: read node properties [bootstrap]
    -> node name          : bootstrap
    -> node type          : bootstrap
    -> node execute       : yes
    -> java path          : C:\j2sdk1.4.2_18-x64
    -> java parameters    : -Djco.jarm=1
    -> java vm version    : 1.4.2_18-b06
    -> java vm vendor     : Java HotSpot(TM) 64-Bit Server VM (Sun Microsystems Inc.)
    -> java vm type       : server
    -> java vm cpu        : amd64
    -> heap size          : 2048M
    -> root path          : E:\usr\sap\ECQ\DVEBMGS00\j2ee\cluster
    -> class path         : .\bootstrap\launcher.jar
    -> OS libs path       : E:\usr\sap\ECQ\DVEBMGS00\j2ee\os_libs
    -> main class         : com.sap.engine.offline.OfflineToolStart
    -> framework class    : com.sap.bc.proj.jstartup.JStartupFramework
    -> registr. class     : com.sap.bc.proj.jstartup.JStartupNatives
    -> framework path     : E:\usr\sap\ECQ\DVEBMGS00\exe\jstartup.jar;E:\usr\sap\ECQ\DVEBMGS00\exe\jvmx.jar
    -> parameters         : com.sap.engine.bootstrap.Bootstrap ./bootstrap ID0036389
    -> debuggable         : yes
    -> debug mode         : no
    -> debug port         : 60000
    -> shutdown timeout   : 120000
    [Thr 7644] JLaunchIStartFunc: Thread 7644 started as Java VM thread.
    [Thr 7644] [JHVM_PrepareVMOptions] use java parameters set by profile parameter
         Java Parameters: -Xss2m
    JHVM_LoadJavaVM: VM Arguments of node [bootstrap]
    -> stack   : 1048576 Bytes
    -> arg[  0]: exit
    -> arg[  1]: abort
    -> arg[  2]: vfprintf
    -> arg[  3]: -Djco.jarm=1
    -> arg[  4]: -Dsys.global.dir=
    ECQA-DB\sapmnt\ECQ\SYS\global
    -> arg[  5]: -Dapplication.home=E:\usr\sap\ECQ\DVEBMGS00\exe
    -> arg[  6]: -Djava.class.path=E:\usr\sap\ECQ\DVEBMGS00\exe\jstartup.jar;E:\usr\sap\ECQ\DVEBMGS00\exe\jvmx.jar;.\bootstrap\launcher.jar
    -> arg[  7]: -Djava.library.path=C:\j2sdk1.4.2_18-x64\jre\bin\server;C:\j2sdk1.4.2_18-x64\jre\bin;C:\j2sdk1.4.2_18-x64\bin;E:\usr\sap\ECQ\DVEBMGS00\j2ee\os_libs;C:\Program Files (x86)\EMC\PowerPath\;C:\Program Files\HP\NCU;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;
    ECQA-DB\sapmnt\ECQ\SYS\exe\uc\NTAMD64
    -> arg[  8]: -Dmemory.manager=2048M
    -> arg[  9]: -Xmx2048M
    -> arg[ 10]: -DLoadBalanceRestricted=no
    -> arg[ 11]: -Djstartup.mode=BOOTSTRAP
    -> arg[ 12]: -Djstartup.ownProcessId=5616
    -> arg[ 13]: -Djstartup.ownHardwareId=Z0120251026
    -> arg[ 14]: -Djstartup.whoami=bootstrap
    -> arg[ 15]: -Djstartup.debuggable=yes
    -> arg[ 16]: -Xss2m
    -> arg[ 17]: -DSAPINFO=ECQ_00_bootstrap
    -> arg[ 18]: -DSAPSTART=1
    -> arg[ 19]: -DCONNECT_PORT=3089
    -> arg[ 20]: -DSAPSYSTEM=00
    -> arg[ 21]: -DSAPSYSTEMNAME=ECQ
    -> arg[ 22]: -DSAPMYNAME=ECCECQ-CIS_ECQ_00
    -> arg[ 23]: -DSAPPROFILE=
    ECQA-DB\sapmnt\ECQ\SYS\profile\ECQ_DVEBMGS00_ECCECQ-CIS
    -> arg[ 24]: -DFRFC_FALLBACK=ON
    -> arg[ 25]: -DFRFC_FALLBACK_HOST=localhost
    -> arg[ 26]: -DSAPSTARTUP=1
    -> arg[ 27]: -DSAPSYSTEM=00
    -> arg[ 28]: -DSAPSYSTEMNAME=ECQ
    -> arg[ 29]: -DSAPMYNAME=ECCECQ-CIS_ECQ_00
    -> arg[ 30]: -DSAPDBHOST=ECQA-DB
    -> arg[ 31]: -Dj2ee.dbhost=ECQA-DB
    CompilerOracle: exclude com/sapportals/portal/pb/layout/taglib/ContainerTag addIviewResources
    CompilerOracle: exclude com/sap/engine/services/keystore/impl/security/CodeBasedSecurityConnector getApplicationDomain
    CompilerOracle: exclude com/sap/engine/services/rmi_p4/P4StubSkeletonGenerator generateStub
    CompilerOracle: exclude com/sapportals/portal/prt/util/StringUtils escapeToJS
    CompilerOracle: exclude com/sapportals/portal/prt/core/broker/PortalServiceItem startServices
    CompilerOracle: exclude com/sap/engine/services/webservices/server/deploy/WSConfigurationHandler downloadFile
    CompilerOracle: exclude com/sapportals/portal/prt/jndisupport/util/AbstractHierarchicalContext lookup
    CompilerOracle: exclude com/sapportals/portal/navigation/cache/CacheNavigationNode getAttributeValue
    CompilerOracle: exclude com/sapportals/portal/navigation/TopLevelNavigationiView PrintNode
    CompilerOracle: exclude com/sapportals/wcm/service/ice/wcm/ICEPropertiesCoder encode
    CompilerOracle: exclude com/sap/lcr/pers/delta/importing/ObjectLoader loadObjects
    CompilerOracle: exclude com/sap/engine/services/webservices/jaxrpc/encoding/InstanceBuilder readElement
    CompilerOracle: exclude com/sap/engine/services/webservices/jaxrpc/encoding/InstanceBuilder readSequence
    CompilerOracle: exclude com/sap/engine/services/webservices/jaxrpc/encoding/TypeMappingImpl initializeRelations
    CompilerOracle: exclude com/sap/engine/services/webservices/jaxrpc/encoding/GeneratedComplexType _loadInto
    [Thr 7644] JHVM_LoadJavaVM: Java VM created OK.
    JHVM_BuildArgumentList: main method arguments of node [bootstrap]
    -> arg[  0]: com.sap.engine.bootstrap.Bootstrap
    -> arg[  1]: ./bootstrap
    -> arg[  2]: ID0036389
    [Thr 7644] JHVM_RegisterNatives: registering methods in com.sap.bc.krn.perf.PerfTimes
    [Thr 7748] Fri Oct 16 14:09:00 2009
    [Thr 7748] JLaunchIExitJava: exit hook is called (rc = 0)
    [Thr 7748] JLaunchCloseProgram: good bye (exitcode = 0)
    stdout/stderr redirect
    node name   : dispatcher bootstrap
    pid         : 7268
    system name : ECQ
    system nr.  : 00
    started at  : Fri Oct 16 14:24:37 2009
    CompilerOracle: exclude com/sapportals/portal/pb/layout/taglib/ContainerTag addIviewResources
    CompilerOracle: exclude com/sap/engine/services/keystore/impl/security/CodeBasedSecurityConnector getApplicationDomain
    CompilerOracle: exclude com/sap/engine/services/rmi_p4/P4StubSkeletonGenerator generateStub
    CompilerOracle: exclude com/sapportals/portal/prt/util/StringUtils escapeToJS
    CompilerOracle: exclude com/sapportals/portal/prt/core/broker/PortalServiceItem startServices
    CompilerOracle: exclude com/sap/engine/services/webservices/server/deploy/WSConfigurationHandler downloadFile
    CompilerOracle: exclude com/sapportals/portal/prt/jndisupport/util/AbstractHierarchicalContext lookup
    CompilerOracle: exclude com/sapportals/portal/navigation/cache/CacheNavigationNode getAttributeValue
    CompilerOracle: exclude com/sapportals/portal/navigation/TopLevelNavigationiView PrintNode
    CompilerOracle: exclude com/sapportals/wcm/service/ice/wcm/ICEPropertiesCoder encode
    CompilerOracle: exclude com/sap/lcr/pers/delta/importing/ObjectLoader loadObjects
    CompilerOracle: exclude com/sap/engine/services/webservices/jaxrpc/encoding/InstanceBuilder readElement
    CompilerOracle: exclude com/sap/engine/services/webservices/jaxrpc/encoding/InstanceBuilder readSequence
    CompilerOracle: exclude com/sap/engine/services/webservices/jaxrpc/encoding/TypeMappingImpl initializeRelations
    CompilerOracle: exclude com/sap/engine/services/webservices/jaxrpc/encoding/GeneratedComplexType _loadInto

  • How can I change the layout on this JDialog?

    Hi , I have the following Dialog with some content. As of now, the line after the separator is displayed in two lines. I was looking for a way to show that in one line and change the column widths a bit so that the rest of the content can each be shown on one line as well, according to the look and feel of a table.
    Here's the code:Please download [TableLayout.jar|http://java.sun.com/products/jfc/tsc/articles/tablelayout/apps/TableLayout.jar] in order to compile.
    Thanks!
    import layout.TableLayout;
    import java.awt.BorderLayout;
    import java.awt.Component;
    import javax.swing.JButton;
    import javax.swing.JDialog;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JSeparator;
    import javax.swing.JTabbedPane;
    import javax.swing.JTextPane;
    import javax.swing.text.StyledEditorKit;
    public class MyDialogTest implements layout.TableLayoutConstants {
         JTabbedPane pane;
         JDialog myDialog;
         JTextPane infoPanel;
        public MyDialogTest() {
             myDialog = new JDialog();
             myDialog.setTitle("MyDialogTest");
             pane = new JTabbedPane();
             JPanel panel = new JPanel(new BorderLayout());
             panel.add(makeTab(), BorderLayout.CENTER);
             pane.addTab("About", panel);
             myDialog.getContentPane().add(pane);
             myDialog.setSize(500, 620);
             myDialog.setResizable(false);
             myDialog.setVisible(true);
        private Component makeTab() {
             JPanel aboutPanel = new JPanel();
            double [][] size = {{PREFERRED, FILL},{PREFERRED, PREFERRED, PREFERRED, PREFERRED, PREFERRED, PREFERRED, PREFERRED, PREFERRED, PREFERRED, PREFERRED, FILL}};
            TableLayout layout = new TableLayout(size);
            aboutPanel.setLayout(layout);
            JLabel headerLabel = new JLabel("About This Application");
            aboutPanel.add(headerLabel, "0, 0, 1, 0");
            aboutPanel.add(new JLabel("Version 4.1"), "0, 1, 1, 1");
            aboutPanel.add(new JLabel(" "), "0, 2, 1, 2");
            aboutPanel.add(new JLabel("Customer Service: 1-800-888-8888"), "0, 3, 1, 3");
            JLabel yahooUrl = new JLabel("www.yahoo.com");
            aboutPanel.add(yahooUrl, "0, 4");
            aboutPanel.add(new JLabel(" "), "0, 5");
            aboutPanel.add(new JSeparator(), "0, 6, 1, 6");
            aboutPanel.add(new JLabel(" "), "0, 7");
            infoPanel = new JTextPane();
            infoPanel.setEditable(false);
            infoPanel.setEditorKit(new StyledEditorKit());
            infoPanel.setContentType("text/html");
            makeInfoPanel();
            aboutPanel.add(infoPanel, "0, 8, 1, 8");
            JButton copyToClipboardButton = new JButton("Button1");
            JButton moreInformationButton = new JButton("Button2");
            JPanel buttonPanel = new JPanel();
            buttonPanel.add(copyToClipboardButton);
            buttonPanel.add(moreInformationButton);
            aboutPanel.add(buttonPanel, "0, 9");
            return aboutPanel;
        private void makeInfoPanel() {
              StringBuffer infoPaneContent = new StringBuffer("<html><head></head><body><table>");
              infoPaneContent.append("<tr><td>Version 4.1 (build  111708-063624"+ "</td></tr>");
              infoPaneContent.append("<tr><td>Customer IP Address:</td>&nbsp <td>10.53.62.11</td></tr>");
              infoPaneContent.append("<tr><td>JMS Server:</td>&nbsp <td>myserver</td></tr>");
              infoPaneContent.append("<tr><td>Quote Server:</td>&nbsp <td>qs2w62m3/qs106w60m3</td></tr>");
              infoPaneContent.append("<tr><td>Login ID:</td>&nbsp <td>programmer girl</td></tr>");
              infoPaneContent.append("<tr><td>Java Version:</td> &nbsp<td>"+ System.getProperty("java.version") + "</td></tr>");
              infoPaneContent.append("<tr><td>Operating System:</td> &nbsp<td>"+ System.getProperty("os.name") + " "+ System.getProperty("os.version") + " ("+ ")" + "</td></tr>");
             infoPaneContent.append("<tr><td>Browser Version:</td>&nbsp <td>"+ "Mozilla/4.0(compatible: MSIE 6.0; Windows NT 5.1; SV!; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648" + "</td></tr>");
              Runtime rt = Runtime.getRuntime();
              infoPaneContent.append("<tr><td>Free Memory (KB):</td>&nbsp <td>("+ rt.freeMemory() / 1000 + " / " + rt.totalMemory() / 1000+ ")</td></tr>");
              infoPaneContent.append("<tr><td>Symbols In Use:</td>&nbsp<td>symbol</td></tr>");
              infoPaneContent.append("<tr><td>JMS :</td>&nbsp<td>connected</td></tr>");
              infoPaneContent.append("<tr><td>Market Data :</td>&nbsp<td>connected</td></tr>");
              infoPaneContent.append("<tr></tr>");
              infoPaneContent.append("<tr></tr>");
              infoPaneContent.append("</table></body></html>");
              infoPanel.setText(infoPaneContent.toString());
         public static void main(String[] args) {
              MyDialogTest test = new MyDialogTest();
    }

    Just sign out and sign in with your UK Apple ID
    Edit: If you press your name on this page (top left), you get "Actions" on the right side. Here you can change timezone, location etc.

  • Center TEXT in JTextArea?

    Is it possible to center text in a JTextArea?
    I searched it but nothing on the web ... Is there another way to do this?
    with JTextPane or JTextEditor?
    I want just to center some text ....
    Thanks

    Do you want editable centered text or do you just want to display centered text and thought that JTextArea/JEditorPane/JTextPane was the only way to do it?
    If you just need to display centered text, you can use JLabel with HTML tags:
    Example:
    String message = "<HTML><CENTER>Centered Text!!!<BR>With line breaks even!!!</CENTER><HTML>"
    JLabel centered = new JLabel(message);

  • How can a JMS Listener Notified get when a Topic Server Goes Down?

    I'm in the process of looking into pub/sub model for a centeralized data source where vertical applications subscribe to a topic to get updates on person demographic information.
              I was playing with the JMS topic examples and noticed that when I have a Durable Subscriber listener (java main) and the topic Server goes down. It never gets notified. When I restart the Topic server and send msgs to the topic, the Durable Listener doesn't get them.
              Once I restart the Durable Listener (java main), it receives all the messages that were pending.
              I implemented the ExceptionListener and it never gets a shutdown msg either. I shutdown the Topic server via Ctrl-C, Graceful Shutdown and Forced Shutdown.
              Is there a way for the client listener to determine when the Topic Server went down, came backup, and restore the connection to it automatically? Or do we have to implement some type of ping mechanism on the client listener and re-create the connection ourselves?
              Thanks. Later...
              - Wayne
              Edited by wlau1000 at 03/07/2007 8:34 AM

    Hi Wayne,
              I think the exception listener should have fired. Some comments/questions:
              - Does your app call "connection.setExceptionListener" in addition to implementing ExceptionListener?
              - Which version and maintenance/service pack are you using?
              - Is the client using the wl* "thin" client jars or the "thick" client jar?
              - Version 9.2 provides an automatic reconnection capability for consumers. This behavior isn't enabled by default due to natural side effects that some apps might not be prepared to handle (needles to say, I recommend reading the doc thoroughly).
              http://edocs.bea.com/wls/docs92/jms/recover.html#wp1320125
              Tom

  • Solution Manager Query

    Hello All,
    I am working on the SAP Solution Manager application. I have a very particular business requirement.
    I am looking out for a solution for Mass Migration of documents from an implementation project to a global template. I have gone through the documentation and know that the opposite is possible.
    I wanted to know if any knows any function module or method to transfer the selected documents from an Implementation Project to a Global Template Project.
    If this is not the right forum for the question please help me as to which SDN Forum to post this message.
    Thanks in Advance..

    Hi,
    Check following servicec. Use transaction SICF then press execute button. Then yoy have to drill down the tree structure for checking these servicec.
    Use
    To be able to use the work centers, you must activate WebDynpro applications (services).
    Default Settings
    Activate services
    Run the following program:
    Technical name: SM_WORK_CENTER
    Check service activation
    You can check whether the services are active.
    Choose the hierarchy type SERVICE.
    1. Choose Execute.
    2. Select the service.
    3. Choose the context menu Test Service.
    (For all services: /default_host...)
    /sap/bc/webdynpro/sap/ags_work_incident_man
    /sap/bc/webdynpro/sap/ags_workcenter
    /sap/bc/ags_workcenter/ags_work_appln
    /sap/bc/ags_workcenter/ags_work_webgui
    /sap/bc/webdynpro/sap/ags_work_trans_print
    /sap/bc/webdynpro/sap/ags_work_incident_create_app
    /sap/bc/webdynpro/sap/ags_work_change_man
    /sap/bc/webdynpro/sap/ags_work_setup
    /sap/bc/webdynpro/sap/ags_work_job_sch_man
    /sap/bc/webdynpro/sap/ags_work_implementation
    /sap/bc/webdynpro/sap/ags_work_bp_iterf_mon
    /sap/bc/webdynpro/sap/ags_work_services
    /sap/bc/webdynpro/sap/ags_rbe
    /sap/bc/solman/nwbc/solmanwork
    /sap/bc/webdynpro/sap/ags_work_gui_selection
    /sap/bc/dal/demoA
    /sap/bc/webdynpro/sap/wdc_wba_rfc_monitoring
    /sap/bc/bsp/sap/wba_start_smdia
    /sap/bc/webdynpro/sap/ags_work_gui_default_set
    You also go through the SPRO Implementation guides for more informations....
    As per my understanding you should check with your network support team for the page not display issue.
    regards,
    Mahantesh

  • InvokeLater

    I have read the documents about the EDT.
    So I have a simple question:
    Suppose you have a JFrame which contains just one JLabel.
    Your application has a thread that receives datagrams from the net.
    You want your JLabel to display the number of packets received.
    So everytime a datagram packet arrives you have to use InvokeLater to repaint the JLabel? Isn't that too heavy?

    I have an idea. Stick to invokeLater, but instead of instantiating a new Runnable every time you want to update, just instantiate a single Runnable object from a (non-anonymous) inner class that has access to the variable being changed, and then keep a reference to this Runnable kicking around. Then you can invoke invokeLater again and again with the same Runnable so you are not instantiating ten objects a second.
    Like I said, I have never actually done anything like this but it is not a particularly bizarre thing you want to do.. so I am sure there is some way to do it without getting too exotic.
    Actually my guess is that even if you just instantiate a new Runnable every darn time you will not notice any performance problems.
    Drake

Maybe you are looking for