Resize block-frame at runtime?

Hello,
is it possible to resize and reposition a block´s frame at runtime? We want to implement a configurable form. Why is the frame not a "block-element" but a "canvas-element"? Is there any posibility to change boilerplates at runtime?
thanks in advance
Anna

You can't change boilerplate elemenets at runtime. As such you can't change the block frame.

Similar Messages

  • Remove the assignment blocks dynamically at runtime

    hello friends,
    i want to remove the assignmnet blocks dynamically at runtime but based on the condition data avilable or not . example for opportunity window, whether the item list assignment block is empty then only i want to delete it . for this case i have to put a validation . im using  DETACH_STATIC_OVW_VIEW method for deleting the assignmnet blocks . but in my case based on validation only i want to delete . how to do the validation. please help me out .
    thanks in advance.
    regards
    sashi

    Hello there,
    I believe the Method DETACH_STATIC_OVW_VIEWS as you mentioned is the correct one to achieve this functionality.
    Here what exactly has to be done in your scenario is not clear from your question.
    However if we consider your example; you can refer to the code excerpt below
    UI COmponent : BT111H_OPPT  ( Header Component of Opportunity)
    Class: CL_BT111H_O_OPPORTUNITYO0_IMPL
    Method : DETACH_STATIC_OVW_VIEWS
    It already has in place
    * get Details CuCo
      lr_cuco ?= me->get_custom_controller( controller_id = 'BT111H_OPPT/OpptDetailsCuCo' ).
    then it checkes the Product Items.
    You can put ou validation logic in place and do like following:
    * Competitor products on Item level
      IF lr_cuco->is_competitor_available( iv_mode = lc_item ) = abap_false.
        ls_viewid-viewid = 'BT111H_OPPT/CompProdItemOV'.
        INSERT ls_viewid INTO TABLE rt_viewid.
         ENDIF.
    Please reply if this helps.
    Best Regards,
    Vinamra.

  • Panel doesn't display properly until I resize the frame

    Hiya folks,
    I'm currently trying to write a simple piece of music notation software. This is my first time using swing beyond a relatively simple JApplet and some dialog stuff. Anywho, I ran into a pretty discouraging issue early on. So far I've got a frame with a menu bar and a toolbar on the bottom border. The toolbar contains a button which should draw a new staff panel containing 11 panels (potentially more) within it, alternating between lines and spaces. Sort of like this:
    import javax.swing.*;
    import java.awt.*;
    public class Staff extends JPanel {
       private static JPanel nsp1,nsp3,nsp5,nsp7,nsp9,nsp11;
       private static JPanel nsp2,nsp4,nsp6,nsp8,nsp10;
       private ImageIcon image= new ImageIcon(this.getClass().getResource( "icons/treble clef.gif"));
        public Staff(){
        setLayout(new GridLayout(11,1));
        add(nsp1= new NoteSpace());
        add(nsp2= new LineSpace());
        add(nsp3= new NoteSpace());
        add(nsp4= new LineSpace());
        add(nsp5= new NoteSpace());
        add(nsp6= new LineSpace());
        add(nsp7= new NoteSpace());
        add(nsp8= new LineSpace());
        add(nsp9= new NoteSpace());
        add(nsp10= new LineSpace());
        add(nsp11= new NoteSpace());
    static class NoteSpace extends JPanel{
        public NoteSpace(){
        setPreferredSize(new Dimension(this.getWidth(),2));
    static class LineSpace extends JPanel{
          public LineSpace(){
          setPreferredSize(new Dimension(this.getWidth(),1));
          public void paint(Graphics g) {
              super.paint(g);
              g.drawLine(0, (int) super.getHeight()/2, (int)super.getWidth(), (int)super.getHeight()/2);
    }Anyway, this panel displays as a tiny box wherein nothing is visible until I resize the frame. Really frustrating. And I have have no idea what the problem might be. Here's the actionlistener:
    jbtcleff.addActionListener(new ActionListener (){
            public void actionPerformed (ActionEvent e){
                staff.setBounds(50,panel.getHeight()/2,panel.getWidth()-50,panel.getHeight()/2);
                panel.add(staff);
                staff.repaint();
            });...which is located in a custom jtoolbar class within the Main class, an extension of JFrame:
    public class Main extends JFrame{
       JMenuBar jmb=new CustomMenuBar();
       JToolBar jtb= new CustomToolBars("ToolBar");
       static boolean isStaff=false;
       static boolean isNote=false;
       static JPanel panel = new JPanel();
       private static Staff staff= new Staff();
        private static Toolkit toolkit= Toolkit.getDefaultToolkit();
       private static Image image=toolkit.getImage("C:/Users/tim/Documents/NetBeansProjects/ISP/src/MusicGUI/icons/treble clef.jpg");
        private static Cursor noteCursor = toolkit.createCustomCursor(image,new Point(0,0),"Image"); 
       public Main (String m) {   
            super(m);
            setJMenuBar(jmb);    
            getContentPane().add(jtb,BorderLayout.SOUTH);       
            panel.setLayout(new CardLayout(60,60));
            getContentPane().add(panel);
    public static void main (String[]args){
            JFrame frame= new Main("Music");
            frame.setSize(800,400);
            frame.setLocationRelativeTo(null);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
            frame.setIconImage(image);
           Sorry for all the code. I'm desperate.
    Thanks!

    Oh my... have you been through the Swing tutorial?
    Let's look at some of your code,
    static class NoteSpace extends JPanel{
        public NoteSpace(){
        setPreferredSize(new Dimension(this.getWidth(),2));
    static class LineSpace extends JPanel{
          public LineSpace(){
          setPreferredSize(new Dimension(this.getWidth(),1));
          public void paint(Graphics g) {
              super.paint(g);
              g.drawLine(0, (int) super.getHeight()/2, (int)super.getWidth(), (int)super.getHeight()/2);
    }Here, NoteSpace and LineSpace are being set to a preferred size of 0x2 pixels, and 0x1 pixels respectfully. If you want them at 0 width, how do you expect them to show? In particular, NoteSpace isn't doing anything special. It's just a panel. Why an inner class? Lastly you should not override paint() for SWING. That's AWT stuff. For Swing, you override paintComponent(Graphics g) .
    Then we have this
    jbtcleff.addActionListener(new ActionListener (){
            public void actionPerformed (ActionEvent e){
                staff.setBounds(50,panel.getHeight()/2,panel.getWidth()-50,panel.getHeight()/2);
                panel.add(staff);
                staff.repaint();
            });I'm not sure what the variable jbtcleff is, but it seems you are adding your Staff panel to "panel" every time a button is pressed.... why? Why not just add it once (outside the action listener) and be done with it. Your panel object has a CardLayout, so I assume you meant to create a new+ staff panel everytime a button is pressed, and then add it to the card layout panel. Even so, setBounds(...) does not seem pertinant to this goal. (In fact, in most situtations the use of setBounds(...) is the antithesis of using layout managers).
    The problem you mentioned though seems to be related to the use of a JPanel (your Staff class) that adds zero-width compontents to a grid array.

  • Frame Moving Runtime using Look and Feel

    Hi All,
    I need creating Frame Moving runtime using Look and feel (Oracle forms 10 g with swing concept). If any bodies know give me a idea and demo files.
    Thanks and Regards
    M.Sathiya

    Dear Francois,
    Thanks all are working good and result also perfect but frame and DnD is not properly working compile time no problem only problem is run time it given error :java.lang.VerifyError:(class:oracle/forms/fd/frame$FrameBorder;methed <init> Signature:(Loracle/forms/fd/frame;)V) please tell me how can solve this problem.
    Regards,
    M.Sathiya

  • So simple, yet so annoying: problem resizing anchored frame with grab bars

    Asked a question yesterday on how to 'snug' an anchored frame to an image. Got the answer and it works great (Esc-m-p)
    Now... the reason I needed to do this is that when I try to resize a frame with the grab bars, it 'jerks' as I move vertically or horizontally.
    What that means is...
    With borders on, the frame border is a dotted line.
    If I grab the left side of a frame and move my mouse to the right to make the frame smaller, the border doesn't move smoothly -- it jumps a distance of about 1.5 of those dotted lines. Thus I can't always make the frame fit nicely.
    Talked to another Frame user and she said that her's drags smoothly.
    So... am I missing a setting somewhere? Any thoughts would be greatly appreciated.

    ##&*!
    I was working over a VPN when I first experienced the problem... everything was slower than molasses. Set Snap off, did some other work, Frame crashed.
    Setting didn't persist, but everything had taken so long I forgot to check it.
    Gah. Yes, Snap off works wonders when it's *actually* off.

  • Resizing graphics frames that have stroke/keylines

    When I resize a graphic frame (with a placed image in it) that has a stroke/keyline, the stroke changes weight and I have to reapply the Object Style which sets the weight. How can I keep the same weight when I resize?
    Also is there a way of changing the default behaviour of SHIFT+Resize box with mouse so that it resizes the frame AND content rather than having to use the more cumbersome ALT+SHIFT+mouse resize? I do that far more often then just resizing the frame and keeping the ratio!

    Scaling Stroke Issue: On the menu bar at the far right, select the flyout and you will see the option "Adjust Stroke Weight When Scaling" here you can deselect to turn off
    Resizing Issue: For just one image, select image, Object > Fitting > Frame Fitting Options > Turn on Autofit and Desired Fitting Option
    Resizing Issue: For multiple images, Object Styles > select stye(s) > Frame Fitting Options > Turn on Autofit and Desired Fitting Option

  • Help setPreferredSize and resizing a frame

    Hey,
    I have an internal JFrame that contains a JPanel which contains an image. The JPanel is the only compnent of the internal JFrame and must take up the whole of the space in the frame. The image must take up the whole of the Jpanel.
    At the moment the image is drawn in the paint component part of the JPanel:
         // draw the racing track
         g.drawImage(track, 0, 0, imageWidth, imageHeight, this);
    I set the preferred size of the JPanel so that the JFrame fits exactly around the image. This is to avoid clipping that would occur if i set the frame to the size of the image. This is implemented in the constructor of the JPanel :
    // track is the image i am trying to draw
         imageWidth = track.getWidth(this);
         imageHeight = track.getHeight(this);
         setPreferredSize(new Dimension(imageWidth, imageHeight));
    In the JInternalFrame I extend I call the pack() method; I believe this is what sets the frame to the right size so that no clipping occurs.
    This works fine; the image currently appears with no clipping. However now I want to resize the internal frame. When this happens I want the image to be resized so that it can appear larger or smaller but it must maintain its original proportions.
    I have the following event listener in place in the class that creates all of the internal frames :
    tFrame.addComponentListener(new ComponentAdapter() {
    public void componentResized(ComponentEvent evt) {
    tFrameComponentResized(evt);
    private void tFrameComponentResized(ComponentEvent evt) {
         trackWidth = tFrame.getWidth();
         trackHeight = tFrame.getHeight();
    I am not sure how to continue from here. Any help would be greatly appreciated!!
    Thanks Guys (and gals!)
    Alex.

    I have no idea if this is what you were looking for :import javax.swing.*;
    import java.awt.*;
    import java.awt.geom.AffineTransform;
    import java.net.URL;
    import java.net.MalformedURLException;
    public class ResizableImage extends JPanel {
         private Image theImage;
         public ResizableImage(Image anImage) {
              if (anImage.getWidth(null) == 0) throw new IllegalArgumentException("Image's width is null");
              if (anImage.getHeight(null) == 0) throw new IllegalArgumentException("Image's height is nul");
              theImage = anImage;
         public Dimension getPreferredSize() {
              return new Dimension(theImage.getWidth(null), theImage.getHeight(null));
         protected void paintComponent(Graphics g) {
              super.paintComponents(g);
              Graphics2D g2D = (Graphics2D)g;
              Dimension available = getSize();
              if (available.width * available.height == 0) return;
              Dimension image = new Dimension(theImage.getWidth(null), theImage.getHeight(null));
              if (image.width * image.height == 0) return;
              if (image.equals(available)) {
                   g2D.drawImage(theImage, 0, 0, null);
                   return;
              double scale;
              if (available.height * image.width < available.width * image.height) {
                   scale = (double)available.height / (double)image.height;
              } else {
                   scale = (double)available.width / (double)image.width;
              g2D.drawImage(theImage, AffineTransform.getScaleInstance(scale, scale), null);
         public static void main(String[] args) {
              try {
                   final JFrame frame = new JFrame("Resizable image");
                   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                   URL imageUrl = new URL("http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/images/Bird.gif");
                   frame.setContentPane(new ResizableImage(new ImageIcon(imageUrl).getImage()));
                   SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                             frame.pack();
                             frame.show();
              } catch (MalformedURLException e) {
                   e.printStackTrace();
    }

  • Problem with dragged component after resizing the frame

    My application is simple: I am displaying an image on a panel inside a frame (JFrame). I am able to drag the image inside the panel. My problem is that, after dragging the image around, if I am resizing the frame, the image goes back to its original position.
    Does anyone know a workaround?
    I have been using the sample provided by noah in his answer (reply no. 3) to a previous question on this forum: http://forum.java.sun.com/thread.jsp?forum=57&thread=126148
    Thank you!

    Chek out the visibility of your components. Some operations may render them invisible. Use the setVisible( boolean ) to make them visible.

  • How to resize a frame to the dimensions of the inner image?

    Hi,
    I'm preparing a JS script.
    I need to resize a frame (InDesign) to the dimensions of an inner image (in fact, the image contained by the frame itself).
    So:
    1) I need to control if the frame is bigger (larger) than the image inside it.
    2) If (1) it's true, I need to obtain the dimensions of the inner image and apply them to the frame.
    3) At the end, I will have that the frame matches perfectly the image.
    Is it possible?
    Thanks and best regards,
    Francesco Jonus

    1) I need to control if the frame is bigger (larger) than the image inside it.
    How do you define this?
    It's obvious for the one on the left, but what about the one on the right?
    If you just care about area, then compute the area and check:
    fb = app.selection[0].geometricBounds;
    framewidth = fb[3]-fb[1];
    frameheight = fb[2]-fb[0];
    framesize = framewidth * frameheight;
    ib = app.selection[0].images[0].geometricBounds;
    imagewidth = ib[3]-ib[1];
    imageheght = ib[2]-ib[0];
    imagesize = imagewidth * imageheight;
    if (framesize < imagesize) {
       alert("Frame is smaller!");

  • Adobe consistently crashes when resizing a frame

    I'm helping a company which publish a review every month with InDesign. The entire document is divided into three columns. Only some titles cover the 3 columns. That seems to be these titles which makes Indesign crashing. As soon as I resize a frame just above this kind of title Indesign crash instantly. I thought about paragraph style, links, layers, but all my tests has been uneffective, impossible to find the reason why Indesign crash. Does someone have an idea to help dealing with it ?
    I'm sorry for this incorrect English and hope some will understand my issue.
    Blaise

    The crash report doesn't show me spscifically what's wrong becasue I'm not an expert at reading them, but it does show it's text related.
    To check to see if span/split is used, you would select the paragraph that spanns the columns and check the settings. Yes, it's a pain to go back to the old way, but if youare crashing because of spanned columns it doesn't make a lot of sense to continue with them.
    Other users have reported problems with the span/split feature.

  • Resize of Frame after frame is created

    Hi,
    I have a tabbed pane inside a Frame. When I press one of the tabs I want to resize the Frame.
    Since the tabbed pane is inside the frame I use the following code:
    this.getParent().setSize(640,480); // This does not resize the frame
    this.getParent().resize(640,480); // This does not resize the frame
    I am using Swing.
    What could be wrong or how do I resize the frame after the frame has been created?
    Thanks.

    Hi,
    I guees I might have not told every detail.
    I have a class called TabbedPane that extends JPanel.
    This class then contains a JTabbedPane.
    I then have a JMainFrame that extends Frame that in turn creates a TabbedPane.
    Inside my TabbedPane class I listen to which Tab the user has selected, depending on which Tab I have to resize the Frame. Here is where I can't get it to work.
    if(index == 1) {
    Dimension d = new Dimension(640,480);
    setPreferredSize(d);
    updateUI(); // DOES not work.                              
    } else {
    Dimension d = new Dimension(400,400);
    setPreferredSize(d);
    updateUI();
    Please help :)
    Thanks

  • Resize a Frame height only

    Hello
    I know that I can resize a frame by setting this frame to resizable. Now I want to resize only height, not width. How I can do that
    Many thanks
    shuho

    hey,
    you could add a component listener to your frame...
    frame.addComponentListener(new ComponentAdapter() {
      public void componentResized(ComponentEvent event) {
        frame.setSize(200, frame.getHeight())); // width is always 200
    });hope that helps :)

  • Can I resize video frame?

    I have the Canon Vixia HF R400, which is lovely. But the video frame is very wide and thin. Is there a way to resize the frame so that it's more square-ish, and less long, thin cinematic rectangle?

    Hi Heatherelena,
    The shape of the recorded video is a by-product of the aspect ratio (the size of the width and the size of the height) of the movie.  This ratio cannot be changed from 16:9.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • Stop From Resizing a Frame

    Which method to use, to stop some one from resizing a frame??
    No maximizing or resizing of the frane.

    setResizable(boolean resizable)
    http://java.sun.com/j2se/1.3/docs/api/

  • How to resize text frames during an XML import please?

    Hello everybody,
    I would like blocks text will automatically resize the height when I import my xml file. How can I do that, please?
    Thanks

    What EXACTLY do you want the script to do?
    Resize every single textframe in the document based on its content? (Fit Frame to Content)
    Only some of them?
    Other things?
    It's a simple script, but you need to be very clear in your requirements.

Maybe you are looking for

  • IMac 24" 2.93GHz turns off

    My AppleCare just ran out a little while ago and now my iMac is starting to shut off. Usually, in iMovie and iPhoto but today if I plug a USB Memory stick in I lose connection to my Bluetooth devices. Yesterday, everytime I tried to open a .pdf file

  • LSMW Logical file 'CS_BI_BOM_CREATE' is not assigned to physical file

    Hi all, I am creating LSMW tool for BOM by standard batch input program. In the specify files push button i m getting this error Logical file 'CS_BI_BOM_CREATE' is not assigned to physical file 'LSMW_C_MDM.119_MAT_BOM_001.lsmw.conv' Message no. /SAPD

  • Preview video in a menu

    When I have a button highlighted in a menu, I want a window beside to play a preview to the video clip which it is linked to (No audio). Is this possible, and how do I do it?

  • Can't log in as an administrator

    My administrator log in will not work, even though I know I am using the right name and password. Because my log in won't work I cannot add many programs or even watch dvds. Unfortrunately I am past the 90 days of support, so I have been trying to fi

  • Badi for vt02n

    Hello experts,          Can any body please tell me any BADI for transaction VT02n which can be used to trigger an IDOC after clicking SAVE icon on the last screen of the transaction.     Regards, Ram.