Swing/Adding Menu's To Layout.

Hi,
I'm having problems trying to add my menu into the frame. I've tried many different options? Put i've been getting no where. I need to also ad BGView as well.
Any thoughts? I need to have it split up into 2 classes as well.
//---Code---//
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class BGMainView extends JFrame { 
public static void main(String[] args) { 
new BGMainView().show();
private BGView bgView;
private BGMenu bgMenu;
public BGMainView() {
bgView = new BGView();
bgMenu = new BGMenu();
bgMenu.setVisible(true);
//Problem with adding them both ???
getContentPane().add(bgView, bgMenu);
setSize(400, 400);
setTitle("Title");
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class BGMenu extends JFrame {
public BGMenu() {
JMenuBar menuBar;
JMenu menu;
JMenuItem menuItem;
menuBar = new JMenuBar();
setJMenuBar(menuBar);
menu = new JMenu("Menu");
menu.setMnemonic(KeyEvent.VK_G);
menuBar.add(menu);
menuItem = new JMenuItem("Quit");
menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.CTRL_MASK));
menu.add(menuItem);
//Build second menu in the menu bar.
menu = new JMenu("Help");
menu.setMnemonic(KeyEvent.VK_H);
menuBar.add(menu);

lets put it simply like this
1) u cant add a frame to a frame
2) there is no method like add(component,component);
check your java documentation

Similar Messages

  • WAD - adding menu entries with JavaScript - help please!

    Hiya,
    I am completely new to JavaScript and I need some help with adding menu entries into my WAD template. Can anyone please help?
    I want to add functionality into my WAD template to enable users adding results rows on a selected characteristic, at a single mouse click. Currently they need to go to the menu -> properties -> characteristic -> display results -> always -> ok. That's five clicks of a mouse (provided they know were to go).
    I want to add this option to the basic menu so that they can click once only.
    What I have managed to figure out so far using SAP help is the following. I have added a Script Item into my WAD Layout and added the following line of code in the Script Editing window:
    sapbi_addToMenu("Add totals", "alternate_context_menu", "X","CHARACTERISTIC", "", "bottom", "", "")
    It worked fine in that it added an extra item "Add totals" to my menu when I righclick on a characteristic. So far so good. However, I have no idea what function I should be using here, or how to code it. Surely WAD uses some function to perform this action, something that I could reuse? Is there a library somewhere of all the function used in WAD?
    Can anyone please help with the code?
    Many thanks,
    Agata

    Hiya again,
    I have managed to partially solve this problem by using the following code. However it requires me to define on which characteristic the function is performed. In this case I have managed to get it working on 0PROJECT, but I want it to be ANY characteristic which has been right clicked?
    Any ideas how I can pass the characteristic name as a VARIABLE, whose value would be read automatically when menu is triggered?
    /* Add Contextmenu entries */
    sapbi_addToMenu("Add totals", "JS_SET_RESULT_VISIBILITY_R", "X","CHARACTERISTIC", "", "bottom", "", "")
    * Javascript functions that are to be integrated into a web template and that
    * are to be used later in the web application ALWAYS have to have the same function
    * signature, i.e. the parameters that will be passed.
    * @param currentState - a list of parameters that describe the state the web item
    * @param defaultCommandSequence - the initially used sequence of commands that
    *       would have been used instead of the custom
    *       script.
    function JS_SET_RESULT_VISIBILITY_R( currentState, defaultCommandSequence ){
    //Note: information can be extracted using the parameter 'currentState'
    // and 'defaultCommandSequence'. In either case create your own object
    // of type 'sapbi_CommandSequence' that will be sent to the server.
    // To extract specific values of parameters refer to the following
    // snippet:
    //  var key = currentState.getParameter( PARAM_KEY ).getValue();
    //  alert( "Selected key: " + key );
    // ('PARAM_KEY' refers to any parameter's name)
    //Create a new object of type sapbi_CommandSequence
    var commandSequence = new sapbi_CommandSequence();
      * Create a new object of type sapbi_Command with the command named "SET_RESULT_VISIBILITY"
    var commandSET_RESULT_VISIBILITY_1 = new sapbi_Command( "SET_RESULT_VISIBILITY" );
    /* Create parameter TARGET_DATA_PROVIDER_REF_LIST */
    var paramTARGET_DATA_PROVIDER_REF_LIST = new sapbi_Parameter( "TARGET_DATA_PROVIDER_REF_LIST", "" );
    var paramListTARGET_DATA_PROVIDER_REF_LIST = new sapbi_ParameterList();
    // Create parameter TARGET_DATA_PROVIDER_REF
    var paramTARGET_DATA_PROVIDER_REF1 = new sapbi_Parameter( "TARGET_DATA_PROVIDER_REF", "DP_1" );
    paramListTARGET_DATA_PROVIDER_REF_LIST.setParameter( paramTARGET_DATA_PROVIDER_REF1, 1 );
      // End parameter TARGET_DATA_PROVIDER_REF!
    paramTARGET_DATA_PROVIDER_REF_LIST.setChildList( paramListTARGET_DATA_PROVIDER_REF_LIST );
    commandSET_RESULT_VISIBILITY_1.addParameter( paramTARGET_DATA_PROVIDER_REF_LIST );
    /* End parameter TARGET_DATA_PROVIDER_REF_LIST */
    /* Create parameter CHARACTERISTIC */
    var paramCHARACTERISTIC = new sapbi_Parameter( "CHARACTERISTIC", "0PROJECT" );
    commandSET_RESULT_VISIBILITY_1.addParameter( paramCHARACTERISTIC );
    /* End parameter CHARACTERISTIC */
    /* Create parameter RESULT_VISIBILITY */
    var paramRESULT_VISIBILITY = new sapbi_Parameter( "RESULT_VISIBILITY", "VISIBLE" );
    commandSET_RESULT_VISIBILITY_1.addParameter( paramRESULT_VISIBILITY );
    /* End parameter RESULT_VISIBILITY */
    // Add the command to the command sequence
    commandSequence.addCommand( commandSET_RESULT_VISIBILITY_1 );
      * End command commandSET_RESULT_VISIBILITY_1
    //Send the command sequence to the server
        return sapbi_page.sendCommand( commandSequence );

  • Adding menu-like buttons to JToolBar (such as Back button in Netscape)

    Hi,
    I wonder wether it is possible to add a menu-like button to a JToolBar. I tried adding a JMenu but didn't succed, since the menu's visual appearance was completely messed up and, furthermore, it didn't respond to mouse clicks.
    Any hints appreciated.
    Janek.

    To do that, I wrote 3 classes.
    At the end, the new menu reacts and can be used exactly as a JMenu.
    The first class is the menu class which extends JMenu :
    import javax.swing.*;
    * This class override the method boolean isTopLevelMenu() to
    * allow a menu to be a top level menu in a JMenuBar and a JTollBar also !
    public class MyMenu extends JMenu {
        public MyMenu() {
            super("");
        public MyMenu(String s) {
              super(s);
        public MyMenu(Action a) {
              super(a);
        public MyMenu(String s, boolean b) {
            super(s,b);
         * Returns true if the menu is a 'top-level menu', that is, if it is
         * the direct child of a menubar.
         * @return true if the menu is activated from the menu bar;
         *         false if the menu is activated from a menu item
         *         on another menu
        public boolean isTopLevelMenu() {
            if (getParent() instanceof JMenuBar  || (getParent() instanceof JToolBar))
                return true;       
            return false;
    }The second class extends JToolBar. It is necessary to redefine the MenuBar behavior : When a menu is pressed, you can move the mouse over the other menus and they will open themselves, etc... So the toolbar must implements the interface MenuElement
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.*;
    * This class implements MenuElement to obtain the same behavior
    * as a JMenuBar.
    public class MyToolBar extends JToolBar implements MenuElement {
         public MyToolBar() {
              super();
         * Implemented to be a <code>MenuElement</code> -- does nothing.
         * @see #getSubElements
        public void processMouseEvent(MouseEvent event,MenuElement path[],MenuSelectionManager manager) {
         * Implemented to be a <code>MenuElement</code> -- does nothing.
         * @see #getSubElements
        public void processKeyEvent(KeyEvent e,MenuElement path[],MenuSelectionManager manager) {
         * Implemented to be a <code>MenuElemen<code>t -- does nothing.
         * @see #getSubElements
        public void menuSelectionChanged(boolean isIncluded) {
         * Implemented to be a <code>MenuElement</code> -- returns the
         * menus in this tool bar.
         * This is the reason for implementing the <code>MenuElement</code>
         * interface -- so that the menu bar can be treated the same as
         * other menu elements.
         * @return an array of menu items in the menu bar.
        public MenuElement[] getSubElements() {
            MenuElement result[];
            Vector tmp = new Vector();
            int c = getComponentCount();
            int i;
            Component m;
            for(i=0 ; i < c ; i++) {
                m = getComponent(i);
                if(m instanceof MenuElement)
                    tmp.addElement(m);
            result = new MenuElement[tmp.size()];
            for(i=0,c=tmp.size() ; i < c ; i++)
                result[i] = (MenuElement) tmp.elementAt(i);
            return result;
         * Implemented to be a <code>MenuElement</code>. Returns this object.
         * @return the current <code>Component</code> (this)
         * @see #getSubElements
        public Component getComponent() {
            return this;
    }The last class and morer difficult is the MenuUI. In my implementation, I use the WindowsLookAndFeel, so I redefine the WindowsMenuUI to look like Windows.
    I give you my code also (please, imagine how difficult it was to write!) :
    import com.sun.java.swing.plaf.windows.*;
    import java.awt.*;
    import java.awt.event.MouseEvent;
    import javax.swing.plaf.ComponentUI;
    import javax.swing.plaf.basic.BasicMenuUI;
    import javax.swing.plaf.basic.BasicGraphicsUtils;
    import javax.swing.event.MouseInputListener;
    import javax.swing.*;
    * Windows rendition of the component.
    * <p>
    * <strong>Warning:</strong>
    * Serialized objects of this class will not be compatible with
    * future Swing releases.  The current serialization support is appropriate
    * for short term storage or RMI between applications running the same
    * version of Swing.  A future release of Swing will provide support for
    * long term persistence.
    public class MyWindowsMenuUI extends WindowsMenuUI {
        private boolean isMouseOver = false;
         private int shiftOffset = 0;
         private int defaultTextShiftOffset = 1;
        public static ComponentUI createUI(JComponent x) {
              return new MyWindowsMenuUI();
         * Draws the background of the menu.
         * @since 1.4
        protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) {
              ButtonModel model = menuItem.getModel();
              Color oldColor = g.getColor();
            int menuWidth = menuItem.getWidth();
            int menuHeight = menuItem.getHeight();
              UIDefaults table = UIManager.getLookAndFeelDefaults();
              Color highlight = table.getColor("controlLtHighlight");
              Color shadow = table.getColor("controlShadow");
              g.setColor(menuItem.getBackground());
              g.fillRect(0,0, menuWidth, menuHeight);
              clearTextShiftOffset();
            if(menuItem.isOpaque()) {
                if (model.isArmed()|| (menuItem instanceof JMenu && model.isSelected())) {
                        // Draw a lowered bevel border
                        g.setColor(shadow);
                        g.drawLine(0,0, menuWidth - 1,0);
                        g.drawLine(0,0, 0,menuHeight - 2);
                        g.setColor(highlight);
                        g.drawLine(menuWidth - 1,0, menuWidth - 1,menuHeight - 2);
                        g.drawLine(0,menuHeight - 2, menuWidth - 1,menuHeight - 2);
                        setTextShiftOffset();
                   else
                   if (isMouseOver() && model.isEnabled()) {
                        // Draw a raised bevel border
                        g.setColor(highlight);
                        g.drawLine(0,0, menuWidth - 1,0);
                        g.drawLine(0,0, 0,menuHeight - 2);
                        g.setColor(shadow);
                        g.drawLine(menuWidth - 1,0, menuWidth - 1,menuHeight - 2);
                        g.drawLine(0,menuHeight - 2, menuWidth - 1,menuHeight - 2);
                   else {
                        g.setColor(menuItem.getBackground());
                        g.fillRect(0,0, menuWidth, menuHeight);
              g.setColor(oldColor);
         * Method which renders the text of the current menu item.
         * <p>
         * @param g Graphics context
         * @param menuItem Current menu item to render
         * @param textRect Bounding rectangle to render the text.
         * @param text String to render
         * @since 1.4
        protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) {
              ButtonModel model = menuItem.getModel();
              FontMetrics fm = g.getFontMetrics();
              int mnemonicIndex = menuItem.getDisplayedMnemonicIndex();
              // W2K Feature: Check to see if the Underscore should be rendered.
              if (WindowsLookAndFeel.isMnemonicHidden()) {
                   mnemonicIndex = -1;
              Color oldColor = g.getColor();
              if(!model.isEnabled()) {
                   // *** paint the text disabled
                   if ( UIManager.get("MenuItem.disabledForeground") instanceof Color ) {
                        g.setColor( UIManager.getColor("MenuItem.disabledForeground") );
                        BasicGraphicsUtils.drawStringUnderlineCharAt(g,text, mnemonicIndex, textRect.x, textRect.y + fm.getAscent());
                   else {
                        g.setColor(menuItem.getBackground().brighter());
                        BasicGraphicsUtils.drawStringUnderlineCharAt(g,text, mnemonicIndex, textRect.x, textRect.y + fm.getAscent());
                        g.setColor(menuItem.getBackground().darker());
                        BasicGraphicsUtils.drawStringUnderlineCharAt(g,text, mnemonicIndex, textRect.x - 1, textRect.y + fm.getAscent() - 1);
              else {
                   // For Win95, the selected text color is the selection forground color
                   if (WindowsLookAndFeel.isClassicWindows() && model.isSelected()) {
                        g.setColor(selectionForeground); // Uses protected field.
                   BasicGraphicsUtils.drawStringUnderlineCharAt(g,text, mnemonicIndex,  textRect.x+getTextShiftOffset(), textRect.y + fm.getAscent()+getTextShiftOffset());
              g.setColor(oldColor);
         * Set the temporary flag to indicate if the mouse has entered the menu.
        private void setMouseOver(boolean over) {
              isMouseOver = over;
         * Get the temporary flag to indicate if the mouse has entered the menu.
        private boolean isMouseOver() {
              return isMouseOver;
        protected MouseInputListener createMouseInputListener(JComponent c) {
            return new WindowsMouseInputHandler();
        protected void clearTextShiftOffset(){
            shiftOffset = 0;
        protected void setTextShiftOffset(){
            shiftOffset = defaultTextShiftOffset;
        protected int getTextShiftOffset() {
            return shiftOffset;
         * This class implements a mouse handler that sets the rollover flag to
         * true when the mouse enters the menu and false when it exits.
         * @since 1.4
        protected class WindowsMouseInputHandler extends BasicMenuUI.MouseInputHandler {
              public void mousePressed(MouseEvent e) {
                   JMenu menu = (JMenu)menuItem;
                   if (!menu.isEnabled())
                        return;
                   MenuSelectionManager manager = MenuSelectionManager.defaultManager();
                   if (menu.isTopLevelMenu()) {
                        if (menu.isSelected()) {
                             manager.clearSelectedPath();
                        else {
                             Container cnt = menu.getParent();
                             if(cnt != null && (cnt instanceof JMenuBar || (cnt instanceof JToolBar))) {
                                  MenuElement me[] = new MenuElement[2];
                                  me[0]=(MenuElement)cnt;
                                  me[1]=menu;
                                  manager.setSelectedPath(me);
                MenuElement selectedPath[] = manager.getSelectedPath();
                if (!(selectedPath.length > 0 && selectedPath[selectedPath.length-1] == menu.getPopupMenu())) {
                        if (menu.isTopLevelMenu() || menu.getDelay() == 0) {
                             MenuElement newPath[] = new MenuElement[selectedPath.length+1];
                             System.arraycopy(selectedPath,0,newPath,0,selectedPath.length);
                             newPath[selectedPath.length] = menu.getPopupMenu();
                             manager.setSelectedPath(newPath);
                        else {
                            setupPostTimer(menu);
              public void mouseEntered(MouseEvent evt) {
                   super.mouseEntered(evt);
                   if (!WindowsLookAndFeel.isClassicWindows()) {
                        setMouseOver(true);
                        menuItem.repaint();
              public void mouseExited(MouseEvent evt) {
                   super.mouseExited(evt);
                   if (!WindowsLookAndFeel.isClassicWindows()) {
                        setMouseOver(false);
                        menuItem.repaint();
    }This UI simulate also the rollover effect.
    And now here is a class to test this code (under 1.4 and Windows L&F):
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.plaf.basic.*;
    public class MenuToolBar extends JFrame {
         public static String windowsUI = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
         public MenuToolBar() {
              super("Menu toolbar");
              setWindowsLF();
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              setBounds(312,250,412,200);
              MyMenu menu = new MyMenu("File");
              MyMenu menu2 = new MyMenu("Help");
              menu.add(new JMenuItem("Try"));
              MyToolBar tb = new MyToolBar();
              tb.firePropertyChange("JToolBar.isRollover", false, true); 
              tb.add(menu);
              tb.add(menu2);
              JToggleButton jt = new JToggleButton("Toggle button", new ImageIcon("tog.gif"));
              jt.setFocusPainted(false);
              tb.add(jt);
              tb.addSeparator();
              JButton jb = new JButton("Button", new ImageIcon("but.gif"));
              jb.setFocusPainted(false);
              tb.add(jb);
              getContentPane().add(tb, BorderLayout.NORTH);     
              setVisible(true);
         public static final void setWindowsLF() {
              try {
                   UIManager.setLookAndFeel(windowsUI);
                   UIManager.put("MenuUI", "MyWindowsMenuUI");
              catch (Exception exc) {
                   System.err.println("Error loading L&F: " + exc);
         public static void main(String[] args) {
              new MenuToolBar();
    }Execute that, to see if the result is OK for you!
    Another thing : could you please report my name if you use and distribute the code ?
    Tell me if this helps you!
    Denis
    [                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Adding menu bar in ALV report

    hi,
    I have written an ABAP report using ALV . We need to add a button to the menu bar of the screen that appears after the report is run, not on the selection screen. And when report is executed user will choose for example STOCK then it has to go to the transaction(QA03).
    thanks in advance.
    Anu.

    Hi,
    Goto SE41, create a pf-status for your alv report program.
    On the next screen, click menu EXTRAS --> click option ADJUST TEMPLATES and select radiobutton LIST VIEWER --> you will get all standard buttons of alv in the pf-status.
    Delete the unwanted buttons and also you can add new buttons if reqd.
    Activate pf-status --> and apply in alv program.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = v_rep_id       " report id
         i_callback_pf_status_set          = 'PF'           " for PF-STATUS
         i_callback_user_command           = 'USER_COMMAND' " for User-Command
         is_layout                         = wa_layout      " for layout
         it_fieldcat                       = it_field       " field catalog
         it_sort                           = it_sort        " sort info
        TABLES
          t_outtab                          = it_final      " internal table
       EXCEPTIONS
         program_error                     = 1
         OTHERS                            = 2.
    *&      Form  pf
    *       SUB-ROUTINE PF IS USED TO SET THE PF-STATUS OF THE SCREEN
    *       ON WHICH THE ALV GRID IS DISPLAYED
    *       -->RT_EXTAB
    FORM pf USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZTG_STAT'.
    ENDFORM.                    "pf
    *&      Form  USER_COMMAND
    *       SUB-ROUTINE USER_COMMAND IS USED TO HANDLE THE USER ACTION
    *       AND EXECUTE THE APPROPIATE CODE
    *      -->LV_OKCODE   used to capture the function code
    *                     of the user-defined push-buttons
    *      -->L_SELFIELD   text
    FORM user_command USING lv_okcode LIKE sy-ucomm l_selfield TYPE slis_selfield.
    * assign the function code to variable v_okcode
      lv_okcode = sy-ucomm.
    * handle the code execution based on the function code encountered
      CASE lv_okcode.
    * when the function code is STOCK
        WHEN 'STOCK'.
          SET PARAMETER ID '<param_id>' FIELD '<field_value>'.
          CALL TRANSACTION 'QA03' AND SKIP FIRST SCREEN.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    Hope this helps you.
    Regards,
    Tarun

  • Adding field in script layout

    Hi,
    My requirement is adding one more field to script layout output but i if i added that field then page exceeds the output, they mentioned tab gap between fields, how to reduce tab gaps.
    can u please provide procedures how to achieve it.
    Best regards,
    Ravi

    Hi
    Check in the Line where u want to write/include ur new field  &LV_NEW& ..
    example
    OLD line             T1   &REGUD-SWABZ(15)&,,&REGUD-SWRBT(16)&
    New Line           T1   &REGUD-SWABZ(15)&,,&REGUD-SWRBT(16)&,,&LV_NEW&
    Also Check that  T1 in Paragraph Formats how many Tabs are declared and change the TAB spaces accordingly...
    surya

  • Unable to Access Menu in SFP Layout tab

    Hi,
    Could someone please help me? In transaction SFP, under the Layout tab, I'm unable to access the Menu (Edit, View, Insert, Layout, Tools, Palletes, Help). Is there any setting which I've missed out?
    Just in case this information is important, my machine is installed with Adobe Reader 7.0.8 and Adobe Lifecycle Designer 7.0.
    Also, if the users that will be using ESS/MSS can only have Adobe Reader 6.0 on their machines, I understand that there would be problems trying to display the PCR within the portal. Is there any fix to this?
    Appreciate your help and thanking you in advance.
    Regards,
    Adeline.

    Hi Adeline,
    1) Can you see the Menu? Or is everything greyed out?
    2) Adobe Reader 7.0.8 is suggested to use for the end users. We had a lot of problems with older releases. Please note that in case of Netweaver 2004 you cannot use Reader 8 or higher yet. Adobe and SAP are working on this issue. (The ACF - Active Component Framework) cannot install properly with Reader 8.
    So the only fix is using Reader 7.0.8. - The problem is client side related, not ADS or PCR related.
    Cheers,
    Noë

  • Help Adding Menu Items to Bridge

    I've created (modified) a couple of Bridge Scripts and finally have them working nicely. Now, I want to add a couple of Menu Commands to execute them. I tried modifying a script in the SDK, SnpAddMenuItem.jsx, which would work fine if I only had one Menu Item/Command. Here is what I have. I obviously don't understand the 'this' object or how to separate the Commands. Help much appreciated.
    function SnpAddMenuItem()
              this.requiredContext = "\tAdobe Bridge must be running.\n\tExecute against Bridge CS5 as the target.\n";
              this.menuID = "snpAddMenuItem";
              this.menuCommandID = "snpAddMenuItemSub";
              $.level = 1; // Debugging level
    SnpAddMenuItem.prototype.run = function()
              var retval = true;
              if(!this.canRun()) {
                        retval = false;
                        return retval;
        var newMenu = new MenuElement( "menu", "Scanning", "after Window", this.menuID );
        var stackCommand = new MenuElement( "command", "Gather NNYY Into Stacks", "at the end of " + this.menuID, this.menuCommandID );
        var maskCommand = new MenuElement( "command", "Process Stacks into Layers", "at the end of " + this.menuID, this.menuCommandID );
              stackCommand.onSelect = function()
                        var scriptFilePath = "~/Documents/Adobe Scripts/AutostackNNYY.jsx";
             var scriptFile = new File (scriptFilePath);
             $.evalFile( scriptFile );
        return retval;
              maskCommand.onSelect = function()
                        var scriptFilePath = "~/Documents/Adobe Scripts/StacksToLayers.jsx";
             var scriptFile = new File (scriptFilePath);
             $.evalFile( scriptFile );
              return retval;
      Determines whether snippet can be run given current context.  The snippet
      fails if these preconditions are not met:
      <ul>
      <li> Must be running in Bridge
      <li> Must only be executed once in a session
      </ul>
      @return True if this snippet can run, false otherwise
      @type boolean
    SnpAddMenuItem.prototype.canRun = function()
              // Must run in Bridge
              if(BridgeTalk.appName == "bridge") {
                        // Stop the menu element from being added again if the snippet has already run
                        if((MenuElement.find(this.menuID)) && (MenuElement.find(this.menuCommandID)))
                                  $.writeln("Error:Menu element already exists!\nRestart Bridge to run this snippet again.");
                                  return false;
                        return true;
              // Fail if these preconditions are not met. 
              // Bridge must be running,
              // The menu must not already exist.
              $.writeln("ERROR:: Cannot run SnpAddMenuItem");
              $.writeln(this.requiredContext);
              return false;
      "main program": construct an anonymous instance and run it,
      as long as we are not unit-testing this snippet.
    if(typeof(SnpAddMenuItem_unitTest ) == "undefined") {
              new SnpAddMenuItem().run();

    This will put the two commands at the bottom of the Tools menu....
    #target bridge  
       if( BridgeTalk.appName == "bridge" ) { 
    var stackCommand = new MenuElement( "command", "Gather NNYY Into Stacks", "at the end of Tools","uniqueId1");
    var maskCommand = new MenuElement( "command", "Process Stacks into Layers","at the end of Tools","uniqueId2");
    stackCommand.onSelect = function () {
    //Your code goes here
    maskCommand.onSelect = function () {
    //Your code goes here

  • ADF 10.1.3 -  Adding menu tabs

    How can I add two menu tabs and each point to a different page?
    I tried to add two menu tabs in the menu1 item of panelPage and added CommandMenuItem for the nodeStamp they are not showing up.

    Hi
    I am posting it as a different question. Could you please answer?

  • How to hide menu drop downs layout

    Can I hide the menu drop downs on my layout pages? They interfere with laying out text and images.

    Hi wayneswhirld,
    Click on the small blue icon next to the menu widget and select top pages. That should hide the drop down menu.
    Regards,
    Abhishek Maurya

  • Adding filed in standard layout FBL1n

    Hi,
    We want to a filed  add in FBL1n Standard layout. the filed is BWTAR (Valuation Type) and structure BEWC
    How its could you explain which is the best option.
    Regards
    Venki

    Hi,
    adding new column to fbl3n fbl5n fbl1n
    Seek posts with function SAMPLE_INTERFACE_00001650
    Piotr
    Edited by: Piotr Pukaluk on Feb 26, 2010 9:43 AM

  • Issue with adding JPanel objects with layout managers

    Hi. The games I made in the past did not contain any customized menus (ie. not from JOptionPane) different components dividing the display screen... so I thought I would try to on my current game I'm working on. So here's the issue: I'm trying to set the GUI up for the game screen.. but when I try to add in additional JPanel objects into the my main JFrame object, all of the JPanel objects stack up at the very top left corner (their not supposed to because I am using a layout manager). Here's my simplified version of the code:
    public void setUpGame(){
         MainGame game = new MainGame();
         game.setLayout(new BoxLayout(game, BoxLayout.Y_AXIS) );
            playPanel = new PlayPanel(); // don't worry about this.. it's a subclass of JPanel.
         playPanel.setPreferredSize( new Dimension(playPanel.width, playPanel.height) );     
            game.add(playPanel);
            JPanel collections = new JPanel();
            collections.setLayout(new FlowLayout() );
            collections.setPreferredSize( new Dimension( 1280, 256));
            miniMapPanel = new MiniMapPanel(); // subclass of JPanel.
         miniMapPanel.setPreferredSize( new Dimension(miniMapPanel.width, miniMapPanel.height) );
            collections.add(miniMapPanel);
            statsPanel = new StatsPanel();
         statsPanel.setPreferredSize( new Dimension(statsPanel.width , statsPanel.height ) );
            collections.add(statsPanel);
            ... // I do the same thing for StatsPanel and CommandPanel objects
            game.add(collections);
            add(game);
            // referencing to the JFrame object
            this.pack();
            setVisible(true);
            setFocusable(true);
    }Notes:
    -The sum of miniMapPanel.width, statsPanel.width, ... , commandPanel.width add up to 1280 pixels.
    - miniMapPanel.height, statsPanel.height, ... , commandPanel.height all have the same height of 256 pixels.
    - What I'm trying to do is set up a GUI very similar to that of StarCraft, and WarCraft.
    - The game is set up in full screen.
    When I compile the program, I see (and I've tested for it) that all of the JPanel objects that were created are all stacked one on top of each other, in the top left corner of the screen. Any ideas and/or suggestions are welcome.

    Hi weng,
    Try the following code example. I think the issue might be in your overridden methods if you did.
        public static void main(String[] args) {
            JPanel viewPanel = new JPanel();
            viewPanel.setBackground(Color.GREEN);
            viewPanel.add(new JLabel("You see a hut here..."));
            JPanel minimapPanel = new JPanel();
            minimapPanel.setBackground(Color.WHITE);
            minimapPanel.add(new JLabel("Minimap!"));
            JPanel commandPanel = new JPanel(new FlowLayout(FlowLayout.LEADING));
            commandPanel.add(new JButton("Characters"));
            commandPanel.add(new JButton("Inventory"));
            commandPanel.add(new JButton("World Map"));
            commandPanel.add(new JButton("Menu"));
            JPanel lifeAndManaPanel = new JPanel(new FlowLayout(FlowLayout.LEADING));
            lifeAndManaPanel.add(new JLabel("Life: 999/999"));
            lifeAndManaPanel.add(new JLabel("Mana: 999/999"));
            JPanel statusPanel = new JPanel(new BorderLayout());
            statusPanel.add(commandPanel, BorderLayout.PAGE_START);
            statusPanel.add(lifeAndManaPanel, BorderLayout.CENTER);
            JPanel bottomPanel = new JPanel(new BorderLayout());
            bottomPanel.add(minimapPanel, BorderLayout.LINE_START);
            bottomPanel.add(statusPanel, BorderLayout.CENTER);
            JPanel game = new JPanel(new BorderLayout());
            game.add(viewPanel, BorderLayout.CENTER);
            game.add(bottomPanel, BorderLayout.PAGE_END);
            JFrame frame = new JFrame();
            frame.getContentPane().setLayout(new BorderLayout());
            frame.getContentPane().add(game, BorderLayout.CENTER);
            frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            frame.setSize(800, 600);
            frame.setVisible(true);
        }

  • ALV List Missing Status Menu (Sorting, choose layout etc)

    Hi,
    I developed a report with ALV List display. When I display the ALV List, why my status menu (normally contains sorting, export to local, choose layout and other buttons) that will appear on top of the ALV report is missing?
    I try to look for the ALV Function Module parameters, but seems non of it related.
    I developed my previous report, it do have the menu there. Just this new report is missing.
    Can someone tell me where to set or code?
    Thanks.

    Hi Irene,
    Please check your pf_status_set routine if you use FM REUSE_ALV_GRID_DISPLAY.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
          i_callback_pf_status_set = 'PF_STATUS_SET'
          i_callback_user_command  = user_command
          i_buffer_active          = space
          i_bypassing_buffer       = 'X'
          is_layout                = er_layout
          it_fieldcat              = er_fieldcat[]
          it_special_groups        = er_sp_group
          i_save                   = 'A'
          is_variant               = e_variant
          it_events                = er_events[]
        TABLES
          t_outtab                 = outtab.
    *  FORM pf_status_set
    FORM pf_status_set USING rt_extab TYPE slis_t_extab.
      DATA: rt_extabw TYPE slis_extab.
      SET PF-STATUS 'STANDARD' EXCLUDING rt_extab.
      SET TITLEBAR 'STANDARD'.
    ENDFORM.                    "pf_status_set

  • Added menu itme but it's greyed out.

    Hi,
    I added a new menu item to a menu however when I load the form the menu item is greyed out. Any ideas as to why it might be doing this.
    TIA.

    agreed.....but sometimes we can't see what is in front of us. I suggested only one simple thing to check. However, it's good that you got the problem yourself and solved it.
    Regards.

  • [solved] Problem adding menu icon to pypanel

    Hello, I'm moving into a new place and I'm putting my desktop in the living room as a community media center since neither me or my roommates own a TV, and I'm the only one with a working desktop. They're used to Windows and a start menu. I'm running Openbox + pypanel and thought I'd make their transition a little easier by adding a start menu icon to pypanel. I followed the instructions here: https://bbs.archlinux.org/viewtopic.php?id=68177 but it isn't working. Everytime I click on the arch icon I just get this in my terminal:
    Error: Invalid key sequence 'C-m'
    Failure converting key sequence 'C-m' to keycodes
    Error: Invalid key sequence 'C-m'
    Failure converting key sequence 'C-m' to keycodes
    xdo_keysequence reported an error for string 'C-m'
    here is the important part of my pypanelrc config:
    ("xdotool key C-m", "/home/neruson/.icons/archlinux/icons/archllinuxiconcrystal128.png"),
    In obkey my key is Ctrl+M and the key text is C-m, anyone know what I'm doing wrong?
    EDIT:
    I should also add I've tried this with the key as SUPER+Space too with the same error.
    EDIT 2:
    Nevermind, solved. I'm just stupid and can't follow directions well... ctrl+m instead of C-m... duh
    Last edited by Mr_ED-horsey (2011-07-15 22:16:47)

    Thanks for the heads up on the scripts.
    ~/.bash_profile has me annoyed though. It's as if it is not being executed. Will have to try adding something with a visible effect to confirm.
    My ~/.bash_profile is owned by me and is executable but it simply will not add the path to the variable.
    Could it be something to do with the way my session is handled?
    I am currently launching my session through GDM via inittab. I know when a session is launched this way, for example, ~/.xinitrc is ignored. Perhaps this is the same for ~/.bash_profile?
    Regarding ~/.bashrc, it does work this way, but it only adds the path when a terminal is launched. I need the path added regardless of a terminal being opened or not.
    Cheers.

  • ADF/Swing probles with nested panels layout.

    When panel is placed in other panel, changing of nested panel layout by changing panel properties, results in adding in jbInit() metod code for setting choosen layout at the end of jbInit and not (as in top panel) at the begining of jbInit(). Many times (for instance when layout is BorderLayout) because of this nested panel is displayd empty. It is necessary of course to manually move lines setting layout before lines which adds components to nested panel. Thou it is possible to do it manually it would be nice not to have remember about it.

    Remi,
    how do I reproduce this? Can you give me a step-by-step instruction? Its not clear from your posting which JDeveloper release you are using (though I assume JDeveloper 10.1.3), nor if the panels are created in external Java file or within the parent panel.
    Frank

Maybe you are looking for

  • How do I play play a dvd from my mac and send to apple tv

    Just got my Apple tv for my new Imac everything works fine. How do I play a dvd on my mac and send to apple tv

  • CS3:  Export PDF crash...located the source, now what?

    InDesign CS3 keeps crashing on page 86 or 87 of a file I'm trying to Export to PDF.  I know this from watching the progress bar move across the screen, everything is fine until the status box shows page 86/87, then poof, InDesign disappears and reque

  • Hyperlinks to other documents in Pages  ?

    Even in such a miserable tool as Ms word, it is possible (though unreliable) to set a hyperllink from a document so as to open a different document which is not a webpage, e.g. a pdf. As far as I can see this was not possible in the previous Pages. D

  • Trouble compiling PHP extension w/ threaded PHP 5.2.4

    Hello, I'm having some trouble installing the Berkeley DB XML PHP extension on Debian Sarge 3.1. First, I installed Berkeley DB XML 2.3.10 using the buildall.sh script into /usr/local/dbxml-2.3.10/. Then, I downloaded PHP 5.2.4 source code, compiled

  • Changing Default Font in Acrobat 7 and/or Acrobat Reader 9

    Anyone know how to change the Default Font in Acrobat 7 and/or Acrobat Reader 9?  Whenever I open a PDF document the text defaults to a Times New Roman or basic font.  Can we change the default font?