Dynamic resize of JButton and JFrame in response to Font

Im supposed to increase the font size of the text with JButton by 1 within each click.
Eventually the text becomes shorter and less visible like WORD becomes WOR... then WO... etc
How to make the button always resize with text so that the text is fully visible and JFrame always resize with button so that the button doesn't change its position within the Frame ?
edit:
I managed to make buttons resize with increasing font
by making
JButton b = new JButton("button");
b.setHorizontalTextPosition(CENTER);
b.setVerticalTextPosition(CENTER);However the window size doesnt increase with components ;[
any help would be appretiated.
Edited by: pimpcane on Dec 11, 2007 12:16 PM

Ok I managed to get it working moreless by
adding pack() to the actionPerformed(...) function
public void actionPerformed(ActionEvent e)
             int index = Integer.parseInt(e.getActionCommand());
          int size = buttons[index].getFont().getSize();
          size++;
          buttons[index].setFont(new Font(name, style, size));
          pack();
}The problem is in the task im given it is forbidden to use pack();
Is there any other method to obtain the same result of JFrame resizing dynamically in response to components resize ?
Edited by: pimpcane on Dec 12, 2007 12:13 PM
Edited by: pimpcane on Dec 12, 2007 12:15 PM

Similar Messages

  • Sizing issues JButton and JTextField

    Hi,
    I am new to swing and could use a little guidance on the placement of JButtons and JTextFields on a component. I have tried the setSize method and it doesn't work so I think it has to do with the layout possibly. I need to know how I can resize the testMe button and enlarge the JTextFields. Here is my code.
    I would appreciate any other suggestions as well.
    Thanks,
    Steve
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class TestButton {
        public static void main(String[] arguments) {
            JFrame frame = new Interface();
            frame.show();
    class Interface extends JFrame {
         private dataPanel screenvar;
         private JTextArea msgout;
         Interface () {
              super("This is a JFrame");
            setSize(600, 200);  // width, height
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JPanel pane = new JPanel();
              // create empty space
              pane.setBorder(BorderFactory.createEmptyBorder(30, 30, 10, 30)); //top, left, bottom, right
              // declare components
              msgout = new JTextArea( 8, 40 );
              dataPanel screenvar = new dataPanel();
              buttonPanel testMe = new buttonPanel(screenvar, msgout);
              // end declare components
            GridLayout grid = new GridLayout(1, 4, 5, 15); // row, col, hgap, vgap
            pane.setLayout(grid);
              pane.add(testMe);
              pane.add(msgout);
                 pane.add( new JScrollPane(msgout));
              pane.add(screenvar);
              msgout.append("Successful");
              setContentPane(pane);
    //          pack();
              setVisible(true);
    class databaseConnection {
    class updateDataFields implements ActionListener {     // 400
         private dataPanel abc;
         private JTextArea msg;
         public updateDataFields(dataPanel xyz, JTextArea msgout) {     // 100
              abc = xyz;
              msg = msgout;
         }     // 100
         public void actionPerformed(ActionEvent evt) {     // 200
              String command = evt.getActionCommand();
                   if (command.equals("TestMe")){     // 300
                        msg.append("\nSuccessful");
                        abc.right01.setText("1000");
                        abc.left02.setText("Hi!");
                        abc.right03.setText("123456");
                   }     // 300
         }     // 200
    }     // 400
    class dataPanel extends JPanel {     // Similar to DataPanel in Duke's Bakery
         JLabel left1, left2, left3, right1, right2, right3;
         JTextField left01, left02, left03, right01, right02, right03;
        public dataPanel () {     // 1
              GridLayout grid = new GridLayout(3, 2, 5, 15); // row, col, hgap, vgap
              setLayout(grid);                    // different than panex.setLayout(xgrid);
              left1 = new JLabel("Left1");
              add(left1);
              left01 = new JTextField(0);
              add(left01);
              right1 = new JLabel("Right1");
              add(right1);
              right01 = new JTextField(0);
              add(right01);
              left2 = new JLabel("Left2");
              add(left2);
              left02 = new JTextField(0);
              add(left02);
              right2 = new JLabel("Right2");
              add(right2);
              right02 = new JTextField(0);
              add(right02);
              left3 = new JLabel("Left3");
              add(left3);
              left03 = new JTextField(0);
              add(left03);
              right3 = new JLabel("Right3");
              add(right3);
              right03 = new JTextField(0);
              add(right03);
    class buttonPanel extends JPanel {     // 200   Similar to ButtonPanel in Duke's Bakery
         public buttonPanel(dataPanel xyz, JTextArea msgout) {     // 100
              GridLayout actionGrid = new GridLayout(1, 1, 5, 15); // row, col, hgap, vgap
              setLayout(actionGrid);                    // different than panex.setLayout(xgrid);
              JButton buttonTest = new JButton("TestMe");
              buttonTest.setSize(5,5);
              buttonTest.addActionListener( new updateDataFields( xyz, msgout ));
              add(buttonTest);
         }     // 100
    }     // 200

    Nope, doesn't work. Does the fact that the JButton is part of GridLayout have any affect on this resizing issue?
    Thanks for your help, I appreciate it.
    Steve

  • How to know the dynamic values for this :AND category_id_query IN (1, :3, )

    Hi Team,
    R12 Instance :
    Oracle Installed Base Agent User Responsibility --> Item Instances -->
    Item Instance: Item Instances > View : Item Instance : xxxxx> Contracts : Item Instance : xxxxx> Service Contract: xxxxx>
    In the above page there are two table regions.
    Notes.
    -------------------------------------Table Region---------------------------
    Attachments
    -------------------------------------Table Region---------------------------
    --the attachments are shown using the query from the fnd_lobs and fnd_docs etc...
    I want to know what are the document types are displayed in this page ?
    --We developed a custom program to attach the attachments to the  services contracts and the above seeded OAF page displays those ..as needed.
    But after recent changes..the Attachments--> table region is not showing the attachments.
    I have verified the query..and could not find any clue in that..
    but i need some help if you guys can provide..
    SELECT *
    FROM
    *(SELECT d.DOCUMENT_ID,*
    d.DATATYPE_ID,
    d.DATATYPE_NAME,
    d.DESCRIPTION,
    DECODE(d.FILE_NAME, NULL,
    *(SELECT message_text*
    FROM fnd_new_messages
    WHERE message_name = 'FND_UNDEFINED'
    AND application_id = 0
    AND language_code  = userenv('LANG')
    *), d.FILE_NAME)FileName,*
    d.MEDIA_ID,
    d.CATEGORY_ID,
    d.DM_NODE,
    d.DM_FOLDER_PATH,
    d.DM_TYPE,
    d.DM_DOCUMENT_ID,
    d.DM_VERSION_NUMBER,
    ad.ATTACHED_DOCUMENT_ID,
    ad.ENTITY_NAME,
    ad.PK1_VALUE,
    ad.PK2_VALUE,
    ad.PK3_VALUE,
    ad.PK4_VALUE,
    ad.PK5_VALUE,
    d.usage_type,
    d.security_type,
    d.security_id,
    ad.category_id attachment_catgeory_id,
    ad.status,
    d.storage_type,
    d.image_type,
    d.START_DATE_ACTIVE,
    d.END_DATE_ACTIVE,
    d.REQUEST_ID,
    d.PROGRAM_APPLICATION_ID,
    d.PROGRAM_ID,
    d.category_description,
    d.publish_flag,
    DECODE(ad.category_id, NULL, d.category_id, ad.category_id) category_id_query,
    d.URL,
    d.TITLE
    FROM FND_DOCUMENTS_VL d,
    FND_ATTACHED_DOCUMENTS ad
    WHERE d.DOCUMENT_ID = ad.DOCUMENT_ID
    *) QRSLT*
    WHERE ((entity_name    ='OKC_K_HEADERS_V'-- :1
    AND pk1_value          IN ( 600144,599046) --:2
    AND category_id_query IN (1, :3, :4, :5, :6, :7) )
    AND datatype_id       IN (6,2,1,5)
    AND (SECURITY_TYPE     =4
    OR PUBLISH_FLAG        ='Y')))
    --='000180931' -- 'ADP118'
    The above seeded query is the one which is used for table region to retrieve the data..
    how to know the dynamic values for this : AND category_id_query IN (1, :3, :4, :5, :6, :7) )
    --Sridhar                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi Patricia,
    is it working for restricted key figure and calculated key figure ??
    Note Number Fisc Period Opening Days
    1 1 2
    2 1 3
    3 1 0
    because I have other restriction, so I create two restricted key figure..
    RK1  with restriction :  Total Number of Note,
    RK2  with restriction :  Total Opening Days ,
    then I Created a calculated key figure, average opening days in a period
    CK1 = RK2 / RK1..
    in this case, I am not sure if it will work or not..
    for example, during RK2 calclation, it might be this   2+3 = 5, the line with 0 will be ignored..
    during RK1 calcualtion, it might be 1 + 1 + 1 = 3. ---> Not sure in this case, the line with opening days 0 will be calculated or not..
    could you please confirm..

  • MAKING TWO REQUESTS FROM A JSP AND HANDLING TWO RESPONSE ????????

    Hi,
    I have a requirement like below.
    When a user clicks on download_pdf link on a web page, he should get the pdf data from the server where at the same time he should be shown with a processing window. Say the time taking for hitting the server and getting the response is 10 sec, the processing window should be shown for 10 sec and immediately it has to close.
    My approach :
    From JSP having download_pdf link :: while onClick I am calling an action which is nothing but a servlet call which will take care of getting the pdf data from the server and shown pdf save,cancel window. Other part is onClick I added a javascript function call which will open a seperate window (nothing but a jsp ) showing the processing icon.
    The problem here is, I can not close the window immediately after we get the response from the servlet.
    As we can not have direct communication between two responses(servlet reponse and processing window jsp) I am not able to close the window.
    My trials to close the processing window JSP :
    I tried to write a javascript in the processing window jsp which will be closed after 10 sec using setTimeout() funtion. But here the problem is the window will be closed after 10 sec where even if servlet call response takes 20 sec.
    Please suggest me if I need to do any design change ?
    Can I use any context attributes to come out of this ?
    What would be the best design for this ?
    Thanks and Regards,
    V.Narayana.

    Thanks for the idea.. I am trying to implement that.. Can you please let me know how Can I make a repetitive ajax call ??
    If anyone interested in code, I am pasting all the sample files I prepared for..
    start.jsp
    ===========================================================================================
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    <script type="text/javascript">
    function call(){
              w='550';
         h='240';
    LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
    settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
    win=window.open("http://localhost:7001/SampleExportWeb/ExportServlet",'',settings);
    function call2(){
              w='550';
         h='240';
    LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
    settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
    win=window.open("http://localhost:7001/SampleExportWeb/statusWindow.jsp",'',settings);
    setTimeout("win.close()",5000);
    </script>
    <input type="button" name="button" value="button" onclick="call();call2()">
    </body>
    </html>
    =========================================================================================================
    statusWindow.jsp
    =============================================================================================================
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page import="org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils"%>
    <%@ page import = "com.bea.netuix.servlets.controls.portlet.PortletPresentationContext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <table border=1 width="100%">
    <tr><td align="center" height="210">
    <table border=1>
    <tr><td align="center">
    </td></tr>
    </table>
    </td></tr>
    Narayana
    <tr><td align="right">
    <div class="buttonBar">
    <div class="floatright">
         <a onClick="window.close();" class="button" title="" href="#">
    <span>
    </span>
    </a>
    </div>
    </div><!-- end buttonBar -->
    </td></tr>
    <%
    %>
    <iframe id="exportCall" height="0px" width="0px"></iframe>
    </table>
    =============================================================================================================
    FlowController.java
    ===============================================================================================================
    package main.java.com.export.servlet;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.lang.reflect.Method;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    * Export Servlet will be invoked by all dashboard widgets to perform common
    * functions (Print, Download, Export XLS/CSV)
    * @author kadalur.r.supreeth
    * @version 1.0
    public class ExportServlet extends HttpServlet {
         public void service(HttpServletRequest req, HttpServletResponse resp)
         throws ServletException, IOException {
              try {
                   System.out.println("ExportServlet :: service: entered");
                   Object exportManager = null;
                   Class exportClass = null;
                   Method invokingMethod = null;
                   * This condition will be executed if requested operation is to
                   * download PDF. Invoke the PDF converter method runtime and open
                   * the window dialogue box with generated PDF file. The requested
                   * operation value should be "pdfConverter".
                   ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
                        OutputStream ostreamPDF = resp.getOutputStream();
                        resp.setContentType("application/pdf");
                        resp.setHeader("Content-disposition", "attachment; filename="
                                  + "downloadfile"
                                  + ".pdf");
                        baosPDF.writeTo(ostreamPDF);
                        ostreamPDF.flush();
                        ostreamPDF.close();
              } catch (Exception e) {
                   System.out.println(
                                  "ExportServlet :: service method exception:"
                                  + e.getMessage());
    =========================================================================================================

  • How do I stop iPhone Safari from dynamically resizing the visual viewport?

    Sorry I post this here, but I couldn't access the developer forums (no error given, it just keeps returning me to this page https://developer.apple.com/devforums/) I'm not even sure wether that's been moved here and it's just the redirection non working.
    I need to Stop iPhone Safari from dynamically resizing the visual viewport, or in other words, to stop it from trying to "fit" the layout into the viewport.
    Why?
    Because any recalculation javascript does on absolutely positioned elements makes the whole site super IRRESPONSIVE.
    I don't know wether the issue is the element going out the already-set layout viewport (which triggers the page resizing to fit the visual viewport) or just the calculations being made constantly, but I can stop the calculations from happening when not "touching" the screen, but I need a way to stop the page resizing.
    I tried setting the viewport width to 1040px, as my layout width, and it fixed the header's width being narrower than the body (or shifted left?), but the whole page is still resized with every motion-frame (one every 3 seconds, due to overloading the redrawing engine)
    Is there a way to prevent that?

    No, that link doesn't solve it. It just says the same is found everywhere online.
    There's probably no way to do it, as per their way they "accidentally" omitted the oposite case: the page being wider than 980. They only mention what to do if the site is narrower. Something I learned is big companies (with reputation management) could let you run in circles for years no answer rather than telling you something is not possible.
    I'm the developer (can't access the dev forums, don't know why) and I DID setup the viewport, scale and other properties but none of them stopped from re-fitting the new re-sized layout in the viewport. They just ensure the "initial" view.
    I think the feature I'm looking for must be achieved with some JavaScript function targeting Safari-proprietary variable/property… if even possible.
    I just had to make things never reaching the edge until somebody contributes something useful

  • How to dynamically resize JPanel at runtime??

    Hello Sir:
    I met a problem, I need to resize a small JPanel called panel within a main Control JPanel (with null Layout) if I click the mouse then I can Drag and Resize this small JPanel Border to the size I need at runtime, I know I can use panel.setSize() or panel.setPreferredSize() methods at design time,
    But I have no idea how to do it even I search this famous fourm,
    How to dynamically resize JPanel at runtime??
    Can any guru throw some light or good example??
    Thanks

    Why are you using a null layout? Wouldn't having a layout manager help you in this situation?

  • Passing parameter between jpanel and jframe

    Hi guys,
    First time posting, so please be nice! :p
    Basically, the problem i'm having:
    I have created a JFrame class, which adds some JPanels to itself to start with (basic layout stuff).
    This JFrame is created and instantiated in main.java, and just displays the basic stuff that i've added.
    On the JFrame are a number of JButtons, and when you click on the JButton each JButton it adds a custom JPanel to the main JFrame. Basically, it provides an easy way to produce a kind of menu system using the JPanels.
    The problem i have, is that each time a textbox is clicked inside one of the custom JPanels, i want it to pass the name of the textbox and jpanel back to a method setLastTextBox() in the JFrame class.
    I tried:
    private void jTextPane1FocusGained(java.awt.event.FocusEvent evt) {
        super.setLastTextBox()
    }But super. is not the correct call. I'm sure its something pretty simple but i can't think what it is, and i tried googling it to no avail.
    I would be extremely greatful if someone could put me back on the right path!
    Thanks,
    --Mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi, Mark
    I hope I understood you rihgt.
    I think that you should add Focus Listeners to the text boxes, rather than panels and create a method setLastTextBox(String panelName, String textBoxName)
    and just write something like that
    textField1.addFocusListener(new FocusAdapter(){
                public void focusGained(FocusEvent e) {
                    String textFieldName = ((JTextField)e.getSource()).getName();
                    String panelName = ((JTextField)e.getSource()).getParent().getName();
                     setLastTextBox(textFieldName, panelName);
            });    that is if you write this code inside your frame class
    otherwise you can get to your frame, by calling the method getParent() and checking its class until its not YourFrameClass (or JFrame) and then just cast it and call the method.
    I hope I was clear
    Ksenia

  • How to dynamically resize taskflow popup set as inlineDocument.

    I've been trying to figure out how to dynamically set the WindowHeight and WindowWidth of a taskflow deployed as a inlineDocument popup. Sadly, neither the forums nor google came to the rescue so I had to actually figure this one out on my own. But at least now is my opportunity to work up some forum karma! :)
    Sample workspace containing the solution is here: http://www.williverstravels.com/JDev/Forums/Threads/2337969/MaxPopupSize.zip
    General Strategy for Solution:
    - Pull the browser height and width using Javascript
            function browserSize(evt)
              var button = evt.getSource();
              var agent = AdfAgent.AGENT;
              var windowWidth = agent.getWindowWidth();
              var windowHeight = agent.getWindowHeight();
              AdfCustomEvent.queue(button, "customEvent",
                width: windowWidth,
                height: windowHeight
              true);
              evt.cancel();
            }- Using a clientListener and serverListener, pull this information into a managed bean and set height / width in button's setWindowWidth(), setWindowHeight() attribute.
      public void onButtonClick(ClientEvent clientEvent)
        Double dw = (Double)clientEvent.getParameters().get("width")-100;
        Double dh = (Double)clientEvent.getParameters().get("height")-100;
        this.popupButton.setWindowWidth(dw.intValue());
        this.popupButton.setWindowHeight(dh.intValue());
        ActionEvent aE = new ActionEvent(this.getPopupButton());
        aE.queue();  
      }- Due to JSF Lifecycle complications, the managed bean will need to call a different button than the one which holds the client and server listener. It will be the second button (popupButton in the code above) which then calls the popup.
    Props to Frank for the client / server listener tutorial: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/56-handle-doubleclick-in-table-170924.pdf
    Props to Martin Deh for the javascript insights: http://martindeh.blogspot.com/2011/03/dynamic-resizing-for-popup-dialogs.html
    Hope this helps someone down the road.
    Will

    Thanks LovettWB ...
    Your question helped me a lot...  I am able to pass these two parameters width/height to my bean and am able to set it to pop-up :)                                                                                                                                                                                                                                                                                                                                   

  • Can you dynamically resize a graphic

    In AW 7, can you dynamically resize a graphic (jpg, or
    whatever) that's already on the screen, with some sort of code.
    Need help. Trying to build a piece, but having issues w/ space.
    Thanks for any help.

    Juice21 wrote:
    > In AW 7, can you dynamically resize a graphic (jpg, or
    whatever) that's already
    > on the screen, with some sort of code. Need help. Trying
    to build a piece,
    > but having issues w/ space. Thanks for any help.
    >
    Not as such. You can:
    - have multiple copies of the same image and flip between
    them (there's
    a Show Me on it)
    - use Flash
    - use alPicView
    <url:
    http://www.apixel.com/page0203.htm#alpicview
    >
    Andrew Poulos

  • Dynamic resizing of popups

    Hi All,
    I am using JDev 11.1.2.4.0 and  bounded taskflows.
    In my fragment I have a popup with panel Window. I want to set the content width & height of this as per the browser
    I followed the steps as per this http://www.ateam-oracle.com/dynamic-resizing-for-popup-dialogs/
    My popup code is as below
                                       <af:popup id="pdfPopup" autoCancel="disabled" partialTriggers="cb1"
                                                  popupCanceledListener="#{rLBean.closeDetachPopup}"
                                                  contentDelivery="lazyUncached">
                                            <af:panelWindow id="pdfWindow" title="Label Design" modal="true"
                                                            stretchChildren="first">
                                                <af:panelStretchLayout id="psl7" startWidth="0px" endWidth="0px"
                                                                       topHeight="0px" bottomHeight="0px">
                                                    <f:facet name="bottom"/>
                                                    <f:facet name="center">
                                                        <af:inlineFrame id="if2"
                                                                        source="/pdfservlet?#{bindings.LId.inputValue}*#{bindings.LVn.inputValue}"/>
                                                    </f:facet>
                                                    <f:facet name="start"/>
                                                    <f:facet name="end"/>
                                                    <f:facet name="top"/>
                                                </af:panelStretchLayout>
                                            </af:panelWindow>
                                        </af:popup>
    This popup is invoked as below
         <af:commandButton text="Maximize" id="cb1" partialSubmit="true"
                                                                          clientComponent="true"
                                                                          icon="/images/maximize_detach.png"
                                                                          shortDesc="Maximize" blocking="true">
                                                            <af:clientListener type="action"
                                                                               method="openPopup('pt1:pdfPopup','pt1:pdfWindow')"/>
                                                        </af:commandButton>
    Javascript method is as below
    function openPopup(popupId, panelWindowId) {
        return function (event) {
            try {
                var agent = AdfAgent.AGENT;
                var windowWidth = agent.getWindowWidth();
                var windowHeight = agent.getWindowHeight();
                //alert('maximize.............');
                var region = AdfPage.PAGE.findComponentByAbsoluteId('r1');
                //alert(region +' ------------ '+popupId+' --------------- '+panelWindowId);
                var popup = region.findComponent(popupId);
                //alert(popup);
                var panelWindow = popup.findComponent(panelWindowId);
                alert(panelWindow);
                panelWindow.setContentWidth(Math.max(100, windowWidth - 100));
                panelWindow.setContentHeight(Math.max(100, windowHeight - 100));
                if (popup != null)
                    popup.show();
                else
                    popup.hide();
            catch (err) {
                alert(err);
    When alert is there, I am getting the ID of panel window and everything works fine.
    But if I comment the alerts, its returning null. I dont know whats going wrong.
    Kindly Help

    Issue is, with the above code, I am not able to get the panel window ID.
    As you'll can see in the javascript code, I have commented the alerts. Magically, if i uncomment one of the alerts, its able to find the ID.
    Yes..!! I have tried this code by setting the clientComponent=true for the pop-up as well as panelWindow. But it didn't help.....
    Kind Regards

  • How to dynamically resize virtualbox console (Arch within Arch setup)

    My host is Arch, and my guest is Arch.  The guest running console without X.  I got 1024x728 resolution by adding vga=772 in guest's menu.1st file.  Is there a way to dynamically resize the guest's console dimensions by dragging virtualbox's window corner, as you can with a windows guest OS?

    Dynamic resizing only works from within X, it doesn't work when in console mode, as it requires the Guest Additions installed.  It might of course work in the future if Virtualbox includes a framebuffer driver with guest additions, but somehow I very much doubt they will

  • Dynamic resize of FAT32 partition with disk utility?

    Hi there.
    I have a 1TB external FAT32 drive with 300GB of data on it.
    I want to convert it to HFS+, but I know there's no easy way to do that.
    What I want to know is can I resize my FAT32 partition to 500MB and keep all the data?
    Then I'll move it to the new HFS+ 500MB partition, delete the original partition and resize the HFS+ partition.
    Or do I have no hope of that?
    Thanks
    Greg

    Greg,
    You're probably out of luck on this one. If the drive was partitioned and formatted by a PC (every drive has a partition map, whether there are multiple partitions or only one), it almost certainly has an "MBR" partition map. This would preclude a dynamic resizing by Disk Utility. It will need to be partitioned using either GUID (Intel) or APM (PPC).
    Scott

  • Dynamically resizing DefaultMutableTreeNode

    Does anyone know how to resize a DefaultMutableTreeNode after it's been created and initially sized? I have a tree that can be resized, but if I dynamically resize it so that some nodes are wider than the tree, I'd like the last few visible characters within the nodes to be replaced by three dots "..." instead of just clipping the text. The JTable does this when you resize a column.
    Thanks,
    Steve Sinai

    I change the two lines below:
    1. This: textField.text = val        to this:  textField.htmlText = val;
    2.  This: return textField.text;     to this:  return textField.htmlText;
    Here we go:
    import flash.events.Event;
    import flash.text.StyleSheet;
    import mx.controls.TextArea;
    public class DynamicTextArea extends TextArea
       public function DynamicTextArea(){
          super();
          super.horizontalScrollPolicy = "off";
          super.verticalScrollPolicy = "off";
          this.addEventListener(Event.CHANGE, adjustHeightHandler);
        private function adjustHeightHandler(event:Event):void{
          //trace("textField.getLineMetrics(0).height: " + textField.getLineMetrics(0).height);
          if(height <= textField.textHeight + textField.getLineMetrics(0).height){
            height = textField.textHeight;     
            validateNow();
        override public function set htmlText(val:String):void{
          textField.htmlText = val;
          validateNow();
          height = textField.textHeight;
          validateNow();
        override public function set height(value:Number):void{
          if(textField == null){
            if(height <= value){
              super.height = value;
          }else{       
            var currentHeight:uint = textField.textHeight + textField.getLineMetrics(0).height;
            if (currentHeight<= super.maxHeight){
              if(textField.textHeight != textField.getLineMetrics(0).height){
                super.height = currentHeight;
            }else{
                super.height = super.maxHeight;         
        override public function get htmlText():String{
            return textField.htmlText;
        override public function set maxHeight(value:Number):void{
          super.maxHeight = value;

  • Dynamically resizing VBoxes

    I have code that changes the cursor indicating user can drag
    to resize VBoxes vertically, horizontally, or diagonally, but I'm
    not sure how to proceed to dynamically resize the VBoxes.
    If the user has the vertical resizing cursor displayed (by
    clicking the top border of the lower VBox) and drags, the VBox
    above the border and below the border should both resize.
    Any ideas for how to proceed with this?
    Code is attached, and all you need are three images 16x16
    px.

    "Greg Lafrance" <[email protected]> wrote in
    message
    news:gnha8u$onj$[email protected]..
    >I have code that changes the cursor indicating user can
    drag to resize
    >VBoxes
    > vertically, horizontally, or diagonally, but I'm not
    sure how to proceed
    > to
    > dynamically resize the VBoxes.
    >
    > If the user has the vertical resizing cursor displayed
    (by clicking the
    > top
    > border of the lower VBox) and drags, the VBox above the
    border and below
    > the
    > border should both resize.
    >
    > Any ideas for how to proceed with this?
    Use VDividedBox instead?

  • Dynamically resizing slideshow with ken burns needed

    Hi,
    does anyone here know a free or commercial slideshow component for AS3 (must work with flex 3) which does the following:
    cross-fading,
    ken burns zooming and panning with per image definition (eg. with xml file)
    scale-to-fill resizing of images
    dynamically resizable frame size (so it can be used as a browser background)
    It should work like on the following site
    http://www.timhupe.com/
    My client wants this, but programming it from scratch will take rather long, so if anyone can help out here, that would be great.
    thanks
    jq

    Chris:
    The export method you used creates a 640 x 480 QT file. If you use the Share->Send to iDVD menu option that will create a 720 x 540 QT file, save it in the Movies folder and automatically put it in iDVD. That should produce a higher image quality final product. If you have an iDVD project already started open it before starting the Share procedure so it will be the selected destination. In any case the larger QT movie will be saved to your Movies folder so you can include it manually is desired.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    G5 Dual Core 2GHz, 2G RAM, 250G HD; G4 Dual 1Ghz, 1.5G RAM, 80G HD,   Mac OS X (10.4.7)   22 LCD Display, 200G & 160G FW HDs, Canon S400, i850 & LIDE 50, Epson R200

Maybe you are looking for

  • CD/DVDW SN-S082D issue - Windows cannot start this hardware device Code 19

    I've had my laptop for a little over a year now and it's had it's fair share of problems, most of which are fixable or there is a workaround. Earlier today I inserted a disc into the drive and tried opening it up, went into "My Computer" and found th

  • 10.5 will not boot after install

    I did an upgrade install of 10.5 on my old tower. It said the install was complete and it needed to restart. I restarted and the apple logo screen came up. After several seconds the machine just shut down. Subsequent attempts to boot from this disk c

  • ERROR = e=13 semget(20160,1,1023) (13: Permission denied) [semux0_mt.c  98

    Hi Experts, I installed Java Stack as add-in on our already existing Abap System (NW04s, HP-UX with an Oracle DB)  and the following issue I have in the std_server0.out stdout/stderr redirect node name   : server0 pid         : 4626 system name : BWU

  • Video podcast is showing in the store but not downloading or streaming

    I've been able to upload the video podcast (~345MB, 50 minutes, 480x272, .m4v) and it will appear in iTunes, but when clicked to download there is no file downloading. It says the length is 0:00. We've tried everything to get this to work and it seem

  • Acrobat toolbars - default to open?

    When I open Acrobat, all of my custom toolbars were previously displayed. I must have accidentally turned this off because, when I open a Acrobat now, the toolbars are hidden. I know how to get them to display again, but how do I return to the defaul