Opening a frame with a pre-defined width/heigth

I want to create a window with a standard width of 320 pixels and a heigth of 240 pixels. Is there an easy way doing this in swing ? I don't want to set the Inner frame's width and heigth to create the effect. Is this possibble and how ?

try to override the getSize method to return always the same size

Similar Messages

  • Opening a frame with button click

    hi all
    when i am going to click a button which is placed in JTabel it should
    open a JFrame with some component.
    thanks & regards
    daya

    This task can be decomposed in two logically unrelated subtasks:
    1: Adding a button in a table column and listening to it
    2: Showing a frame from some method
    In case you are hesitant how to solve the first task: you need to create your own cell editor (possibly by extending DefaultCellEditor) that returns a button as editor component. Of course this editor must be set to the desired column(that must be editable too). And just listen to that button's actions.
    Another possible solution is to just render the column with a button and listen the table for mouse clicks, then determine the ros/column for the click and act correspondingly.
    The solution of the second task depends entirely on you.
    HTH
    Mike

  • Frame in frame with graphics problem-or maybe not

    Hi from Croatia.
    Well I have and extremely demanding costumer that wants to control every single bit of the project.
    The problem is as follows.
    I have a book that every once in a wile has annotation which above and bellow has a graphic line (not simple line but complex graphic imported from illustrator.)
    I tried to anchor one object above and another bellow this text which lets say stands in the middle of text frame and for me everything works ok.
    But this demanding customer wants that those annotations are in separate frame so that he can have full control over them(?).
    So I made frame in frame-put wrapping around this smaller frame.
    The problem is- is it possible to put those graphics in this smaller frame, create text object and add it to library so that i can use it multiple times. I have more than hundred of those annotations.
    And is it possible when i cut the text from this main frame to paste it in this smaller one and that this small frame automatically fills with text so that frame expands vertically according with amount of text. I am not placing text but pasting. I hope you have understood but in every case here is an example.
    Main text frame(text fills full width of page)
    sadbhjasdsdab
    sagsafgsfgafsd
    agsfgfasg
    (Now smaller frame with graphic fills full width of main frame)
    ewfewtf
    agasg
    sdagasdga
    (text fom main frame continues)
    fasdfs
    dsgasgasg
    dfgdfsg
    dfsgsd
    Uf this was exhausting even for me.
    THX for any help.

    I tried to use 3 row table with header and footer, but the problem is that indesign does not allow tables to break when the part of table goes to another page.
    And THX for in for on those plugins.

  • Opening document in frame with javascript

    Hello.
    I've got problem with javascript on Safari 4 (both and on Win and on MacOS), while trying to open html document in frame.
    Reproducing the problem is quite difficult, so I'll begin with html source.
    I have one frame in index.html file:
    +<iframe id="topframe" name="topframe" scrolling="no" frameborder="0" width="980" height="580" src="form1.html";></iframe>+
    form1.html looks like this:
    +<input type="button" id="action" name="action" value="Make action" onclick = "document.getElementById('actionframe').src='dir/action.html';">+
    +<input type="button" id="sel" name="sell" value="..." onclick = "top.frames[['topframe']].location.replace('form2.html');">+
    action.html source is:
    +<script type="text/javascript">parent.document.getElementById('sel').click();</script>+
    So, when you open index.html, you see two buttons: first opens form2.html in the same frame, second opens dir/action.html in other frame. While dir/action.html just "clicks" the first button.
    Basically both buttons does the same.
    The problem is, that Safari fails to open form2.html with first button. Somehow Safari thinks that form2.html is in /dir/, like action.html is. So you get this error:
    *Not Found*
    *The requested URL /safari_test/dir/form2.html was not found on this server.*
    This example works on all major browsers, except Safari 4. Even on Safari 3 it works fine.
    I made an example, so you can test it here:
    http://82.135.245.49/safari_test/
    Message was edited by: Elvinas

    Have you tried putting the full URL instead of just form2.html?
    Second option is to move the file to that directory and change it for the other browsers.
    Third option is to stop using frames altogether, they are generally considered bad practice and can cause issues with browsers that aren't IE.

  • How to use pre-defined scenarios for RosettaNet with XI 3.0

    Hi all.
       I am working in Comgroup Shanghai co. ltd. which is partner of SAP China.
       We have a potential customer who use RosettaNet as their Supply Chain EDI system.
       I would like to make a demo for demostrate the pre-defined scenarios for RosettaNet RNIF 2.0 packages.
       Where can I find such guideline ? I have checked the article: implementing RosettaNet with XI 3.0, but it cannot help me.
       Another question is how I can develop my own scenarios for the RNIF standards which are not included in XI RosettaNet business package ?

    Hi Andy,
    See the instructions below after you installed the RosettaNet STK.
    Below given is the sample config for PIP3B2 Scenario. Part I is using STK and Part II is using 2 XI systems.
    <b>Part I. Test Using STK</b>
    In your XI ID:
    1) Define both the parties 1) Shipper(Your Partner) 2) Receiver(Your company) with identifiers like DUNS Number.
    2) In ID goto>Tools>Transfer Integration Scenarios from IR-->select the scenario "PIP3B2_Receiver" from the drop down list.
    3) Follow the 4 steps in the config wizard.
    4) While creating your CC, create it from the channel template delivered with the RosettaNet BP.
       4.1) Specify the URL for STK which should be in the following format
    http://<STK Server>:<port>/rosettanet/servlet/listenerServlet?userId=<Party Name>
       4.2)In the location fields, enter your location and your partner location.
    In your STK
    1) Start the RosettaNet STK.
    2) enter the UserID<Partner Name in XI>
    3) Select the Test Scenario, 3B2V01.01-AdvanceShipmentNotification-0001-Scenario-Shipper
    4) Enter Global Business ID(DUNS Number) and Location ID for both the partners. These fields should be same as in your R/3 Party configuration.
    5) Enter the URL as follows:
    http://<XI Server:<J2EE_Port>/MessagingSystem/receive/RNIFAdapter/RNIF
    If everything is configured correctly as mentioned, you should be able to test your single-action scenario.
    <b>Part II Test using another XI System</b>
    For these follow the steps above for XI Config.
    Configure one XI System as PIP3B2 Shipper using the Scenario "PIP3B2_Shipper" and config wizard as mentioned above.
    Configure the other XI as PIP3B2 Receiver using the scenario "PIP3B2_Receiver" and config wizard.
    In the Url field, specify the URL as follows:
    http://<XI host>:<J2EE_Port>/MessagingSystem/receive/RNIFAdapter/RNIF
    Hope this helps.
    Regards,
    Sam Raju

  • Help! How to Open a Frame from applet with

    Hey all. I need help =).
    I want:
    1. Have 1 class extends applet with running thread (this far no prob)
    2. Open a new frame from the applet (no prob)
    3. Start a new thread which is operating "inside" the new Frame/class
    4. Draw a simple Rect in the new Frame with the new thread to test that the graphics work.
    Plz help,
    ~Trobsky

    �rr..... i cant draw on the Frame =(.
    Heres the code:

    public class Fonster extends java.applet.Applet {
         Frame myFrame;
         Fri friFonster=new Fri();
         public void init() {
              myFrame=new Frame();
              myFrame.resize(300,300);
              myFrame.show();
              myFrame.add(friFonster);
              friFonster.init();
              friFonster.start();
         public void paint(Graphics g)
              g.drawRect(10,10,100,100);
    public class Fri extends java.applet.Applet {
         public void init(){
              repaint();
         public void paint(Graphics g)
              g.drawRect(10,10,200,200);

  • How to export multiple copies reoprts based on parameters and with pre-defined naming

    Hi All:
    I have a problem of using SSRS 2012, we have multiple clients and they wanted us to deliver the pre-defined excel reports to different branches based on selecting the "branch name" parameter, also they have a naming rule for the excel
    report file.
    We cannot use the subscription as they need to do it in one batch and upload to an FTP file, therefore we are doing this manually for over 300 reports. Is this a convenient way to generate them in one batch as well as customising their file names?
    Thanks a lot for your help.
    Cheers
    Johnny

    Hi JohnnyKahWang,
    As per my understanding, there are multiple clients, you want to deliver reports to clients according to branch name parameter, and naming the excel file according to the rule. If that is the case, we can use data-driven subscription to achieve your goal.
    Reporting Services provides data-driven subscriptions so that you can customize the distribution of a report based on dynamic subscriber data. Data-driven subscriptions use query results to determine the recipients of the subscription, delivery settings,
    and report parameter values. At run time, the report server runs a query to get values used for subscription settings. We can use the Create Data-driven Subscription pages to define the query and assign query values to subscription settings. For detail information,
    please refer to the following steps:
      1. Open Report Manager, and locate the report for which you want to create a data-driven subscription.
      2. Hover over the report, and click the drop-down arrow.
      3. In the drop-down menu, click Manage. This opens the General properties page for the report.
      4. Select the Subscriptions tab, and then click New Data-driven Subscription.
      5. Choose a method of delivery, then select data source for the subscription.
      6. Specify a query that retrieves subscriber data like below:
    CREATE TABLE Name (
    BranchName varchar(20),
    ExcelFileName varchar(20),
    Email_to varchar(50)
    INSERT INTO Name values
    ('Branch1', 'Name1', '[email protected]'),
    ('Branch2', 'Name2', '[email protected]'),
    ('Branch3','Name3', '[email protected]');
      IF we chose Windows File Share delivery extension, we can define path in the query.
      7. Specify delivery extension options like below:
      8. Specify report parameters to BranchName.
      9. Specify when the subscription is processed, then click Finish to save the configuration.
    For more information about Data-driven Subscription, please refer to the following documents:
    http://msbimentalist.wordpress.com/2013/08/26/how-to-create-data-driven-subscription-in-ssrs/
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu

  • Problem with opening new frame in netbeans

    Hi...
    I have created a jframe in netbeans when i try to open this frame now i got a warning form loaded with errors errors occurred in loading the form data.....
    How to solve this problem?

    How to solve this problem?Learn Java.
    [http://catb.org/~esr/faqs/smart-questions.html]
    db

  • Custom UME attribute with pre-defined values

    All,
    Is it possible to define a custom UME attribute which will have pre-defined values so that it appears as dropdown select when the admin creates a user?
    Your help is appreciated.
    Thanks

    Hi Aakash,
    I am not a software developer so I cannot really give you details. I can point you to our documentation: [SAP NetWeaver Developer's Guide|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/8b/0b674240449c60e10000000a1550b0/frameset.htm]
    This guide should point you in the right direction. The UME has a public API with which you access the attributes in question programmatically. What you do from there depends what you as a programmer want to do.
    -Michael

  • How to create reports with the prompts like the pre-defined reports ?

    We are analyzing pre-defined report: Historical Pipeline Analysis. When executed we can see the prompts for Pipeline Fiscal Quarter and Pipeline Fiscal Year.
    If we open this analysis I cannot see how this prompt have been built.
    If I save this pre-defined report (without any change) to My Folders and execute it from here, the prompts are gone.
    I´d appreciate any help.
    Antonio

    I have the same issue. The prebuilt reports are actually dashboards, which is why the dashboard prompt filters show up.
    I'm not sure how they get it to be a link like that on the reports tab (since the link doesn't point to a dashboard URL ).
    Any idea how to get this same effect assuming I built the dashboard/prompt around updated report?

  • PLEAS help opening a frame when clicking a button

    i have a applet and when i click on a button it opens a frame. i have atried a couple of things but the frame does not open. Can anybody Please help
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class mainscreen1 extends Applet implements ItemListener, ActionListener
    private Image layout1;
    private int frame;
    private int xpos,ypos,xdir,ydir;
    public TextField tn, tt1, tt2, total;
    public int value, ticketnum, sum;
    public Label title, seat, need, payable;
    public Button b1, b2;
    Mydialog1 d;
    public void init()
         setBackground(Color.pink);
    setSize (600, 460);
    setLayout(null);
         xpos = getSize().width/-1400;
         ypos = getSize().height/12;
         layout1 = getImage(getDocumentBase(),"layout1.gif");
    title=new Label("Almeida Theater booking system");
         title.setBounds(150,0,185,30);
         add(title);
    seat=new Label("Please choose a seating location:");
         seat.setBounds(300,40,190,25);
         add(seat);
    payable=new Label("Total Payable:�");
         payable.setBounds(300,390,100,30);
         add(payable);
         need=new Label("Please enter the number of seats needed:");
         need.setBounds(300,180,245,30);
         add(need);
         CheckboxGroup radio = new CheckboxGroup();
         Checkbox Stalls = new Checkbox("Stalls", true, radio);
         Stalls.setBounds(490,40,60,25);
         add(Stalls);
         Stalls.addItemListener(this);
         Checkbox Balcony = new Checkbox("Balcony", false, radio);
         Balcony.setBounds(490,65,65,25);
         add(Balcony);
         Balcony.addItemListener(this);
         Checkbox Concessions = new Checkbox("Concessions", false, radio);
         Concessions.setBounds(490,90,94,25);
         add(Concessions);
         Concessions.addItemListener(this);
    Button b1=new Button("Quote");
         b1.setBounds(20,395,80,30);
         add(b1);
         b1.addActionListener( this );
         Button b2=new Button("Confirm booking");
         b2.setBounds(110,395,100,30);
         add(b2);
         b2.addActionListener( this );
         tt1=new TextField(60);
         tt1.setBounds(300,250,270,30);
    add(tt1);
         tt1.addActionListener(this);
         tt2=new TextField(60);
         tt2.setBounds(300,300,150,30);
         add(tt2);
         tt2.addActionListener(this);
         tn=new TextField(3);
         tn.setBounds(545,180,30,30);
         add(tn);
         tn.addActionListener(this);
         total=new TextField(5);
         total.setBounds(400,390,45,30);
         add(total);
         total.addActionListener(this);
    public void itemStateChanged(ItemEvent e)
         String c1 = (String) e.getItem();
         if (c1 == "Stalls")
              value = 20;
         else if (c1 == "Balcony")
              value = 15;
         else
              value = 10;
         tt1.setText("You have chosen to sit in the " + c1 + " area");
         tt2.setText("Each seat will cost: �" + value);
         repaint();
    public void actionPerformed ( ActionEvent e )
    if( e.getActionCommand() == "Quote" )
         //String sum = (String) e.getItem();
    //sum = value*ticketnum;
         //Ssumtotal
         //total.setText(sum);
    else if( e.getActionCommand() == "Confirm booking")
    d = new Mydialog1(new Frame());
              ticketnum = Integer.parseInt(tn.getText());
              repaint();
         public void paint(Graphics g)
              g.setColor(Color.black);
              g.drawString ("You have chosen:" + ticketnum +" seats", 300, 365);
              g.drawImage(layout1,xpos,ypos,null);
    Above is the 1st screen and when i click
    confirm booking it don't open the frame, which is below:
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Mydialog1 extends Frame implements ActionListener
    public Label title;
    public Button b1, b2;
    public void init()
         setBackground(Color.pink);
    setSize (600, 460);
    setLayout(null);
         setLocation(320,140);
         setVisible(true);
         Mydialog1(Frame f);
    title=new Label("Almeida Theater booking system");
         title.setBounds(150,0,185,30);
         add(title);
         Button b1=new Button("Close");
         b1.setBounds(20,395,80,30);
         add(b1);
         b1.addActionListener( this );
         Button b2=new Button("Proced with booking");
         b2.setBounds(110,395,100,30);
         add(b2);
         b2.addActionListener( this );
    public void actionPerformed( ActionEvent e )
    if( e.getActionCommand() == "Close" )
    this.dispose();
    else if( e.getActionCommand() == "Proced with booking")
    setBackground(Color.blue);
    Can anyone help also can anyone explain how i do calcualtions on the mainscreen.calss. the bit that says Quote. it has // cos i canot get it to work
    PLEASE PLEASE

    no, you dont have to create a new class.
    here is your own code. This time we pass the parameters to another method, and
    not the constructor.
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class mainscreen1 extends Applet implements ItemListener, ActionListener
    private Image layout1;
    private int frame;
    private int xpos,ypos,xdir,ydir;
    public TextField tn, tt1, tt2, total;
    public int value, ticketnum, sum;
    public Label title, seat, need, payable;
    public Button b1, b2;
    Mydialog1 d;
    String c1;                   // obs
    public void init()
    setBackground(Color.pink);
    setSize (600, 460);
    setLayout(null);
    xpos = getSize().width/-1400;
    ypos = getSize().height/12;
    layout1 = getImage(getDocumentBase(),"layout1.gif");
    title=new Label("Almeida Theater booking system");
    title.setBounds(150,0,185,30);
    add(title);
    seat=new Label("Please choose a seating location:");
    seat.setBounds(300,40,190,25);
    add(seat);
    payable=new Label("Total Payable:�");
    payable.setBounds(300,390,100,30);
    add(payable);
    need=new Label("Please enter the number of seats needed:");
    need.setBounds(300,180,245,30);
    add(need);
    CheckboxGroup radio = new CheckboxGroup();
    Checkbox Stalls = new Checkbox("Stalls", true, radio);
    Stalls.setBounds(490,40,60,25);
    add(Stalls);
    Stalls.addItemListener(this);
    Checkbox Balcony = new Checkbox("Balcony", false, radio);
    Balcony.setBounds(490,65,65,25);
    add(Balcony);
    Balcony.addItemListener(this);
    Checkbox Concessions = new Checkbox("Concessions", false, radio);
    Concessions.setBounds(490,90,94,25);
    add(Concessions);
    Concessions.addItemListener(this);
    Button b1=new Button("Quote");
    b1.setBounds(20,395,80,30);
    add(b1);
    b1.addActionListener( this );
    Button b2=new Button("Confirm booking");
    b2.setBounds(110,395,100,30);
    add(b2);
    b2.addActionListener( this );
    tt1=new TextField(60);
    tt1.setBounds(300,250,270,30);
    add(tt1);
    tt1.addActionListener(this);
    tt2=new TextField(60);
    tt2.setBounds(300,300,150,30);
    add(tt2);
    tt2.addActionListener(this);
    tn=new TextField(3);
    tn.setBounds(545,180,30,30);
    add(tn);
    tn.addActionListener(this);
    total=new TextField(5);
    total.setBounds(400,390,45,30);
    add(total);
    total.addActionListener(this);
    public void itemStateChanged(ItemEvent e)
    c1 = (String) e.getItem();
    if (c1 == "Stalls")
    value = 20;
    else if (c1 == "Balcony")
    value = 15;
    else
    value = 10;
    tt1.setText("You have chosen to sit in the " + c1 + " area");
    tt2.setText("Each seat will cost: �" + value);
    repaint();
    public void actionPerformed ( ActionEvent e )
      if( e.getActionCommand() == "Quote" )
        //String sum = (String) e.getItem();
        //sum = value*ticketnum;
        //Ssumtotal
        //total.setText(sum);
      else if( e.getActionCommand() == "Confirm booking")
        int nr_seats = Integer.parseInt(tn.getText());
        total.setText("" +nr_seats*value);
        d = new Mydialog1();
        d.set_text(c1, nr_seats); // pass the c1 and the nr_seats vriables to the
                                  //  set_text method in the Mydialog1 class.
      ticketnum = Integer.parseInt(tn.getText());
      repaint();
    public void paint(Graphics g)
    g.setColor(Color.black);
    g.drawString ("You have chosen:" + ticketnum +" seats", 300, 365);
    g.drawImage(layout1,xpos,ypos,null);
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Mydialog1 extends Frame implements ActionListener
      public Label title;
      public Button b1, b2;
      TextField tf; ///***/
      public Mydialog1()
        setBackground(Color.pink);
        setSize (600, 460);
        setLayout(null);
        setLocation(320,140);
        //Mydialog1(Frame f);
        title=new Label("Almeida Theater booking system");
        title.setBounds(150,0,185,30);
        add(title);
        Button b1=new Button("Close");
        b1.setBounds(20,395,80,30);
        add(b1);
        b1.addActionListener( this );
        Button b2=new Button("Proced with booking");
        b2.setBounds(110,395,100,30);
        add(b2);
        b2.addActionListener( this );
        tf = new TextField();                    //new
        tf.setBounds(230, 395, 100,30);   //new
        add(tf);                                       //new
        setVisible(true);
      public void actionPerformed( ActionEvent e )
        if( e.getActionCommand() == "Close" )
          this.dispose();
        else if( e.getActionCommand() == "Proced with booking")
          setBackground(Color.blue);
       *  Folowing method can take two parameters. One string and one int.
      public void set_text ( String seat_type, int nr_seats ) 
        tf.setText (seat_type +". "  +nr_seats);
    }

  • How to open new window with required size when clicking on image in a table

    Hi,
    There is an image column in advanced table. i want to open new window with required parameters(size, toolbar, status bar,etc..) and with that transaction context.
    can any one help plzzzzzzzz?
    Thanks
    Raju

    You can also use OAF js function to open modal pop up:
    openWindow(self, '<url>','longTipWin', {width:900, height:400}, true); return false;
    --Mukul                                                                                                                                                                                                                                                                                                                                   

  • Opening a frame from an applet

    Hi,
    I want to open a frame in my applet. If I'm using swing, JApplet opening a JFrame, is it possible to keep the frame open if the user browses away from the page that holds the applet?
    Are there any tricks? I've tried opening it in a new Thread, but it still goes away when the the browser's page changes.
    Could I call getParent() from the applet until I get an instance of Frame (which would be the browser) and set my JFrames' parent? Or does that only work with the old Netscape and old AWT Frames?
    I basically want to know if I can keep my JFrame open until the browser is closed. Any ideas or suggestions would be greatly appreciated.
    thank you very much

    Do you want to open a jsp application in a frame when you click on the applet?If so, there is a programme in http://www.globalleafs.com -Java-Java Applets 's download section. Check it out.

  • Custom Report using pre-defined template

    In 2012, How to create custom report using pre-defined reports template in below format?
    Column1 :- Device Name
    Column2 :- When installed (Date & Time)
    Column3 :- Success (Date & Time)
    Column3 :- Failed (Date & Time - With which error code)
    Column4 :- Not Installed
    Regards,
    Onkar.

    Here is what you need to do.
    Start by writing the SQL query that you want.
    Clone one of the existing report
    Replace the SQL query with the new query.
    Update the columns with what you need.
    http://www.enhansoft.com/

  • How do I open a frame in a new window or tab?

    I want to be able to open frames into their own tabs or window... So how do you do this, or is Firefox NOT CAPABLE of this... i.e. it's LAME and should be shot? (=:]
    How do I open a frame in a new window or tab?
    ========================
    Basically... I right click, and a context menu pops up... and there is no option for what I want to do... basically because the frame is so small, and the frame table for this particular site is set to fixed... so you can't resize them... so it's almost impossible to read. If only I could easily click and open in a new window or tab...
    I mean... yeah, I can VIEW SOURCE by hand, manually, and find grope the freaking HTML until I find the desired frame URL... but Uhh... likee that's really inefficient, and a waste of time and frankly gives me a headache...
    There's got to be an easy way to do this... either with a setting, which I fail to know about, or by a plugin or extension... or by tweaking the source code... but I'm not a programmer, so I'm handicapped there.

    If you right-click and don't see a context menu item that says '''This Frame''', that page isn't made with Frames; I-frames aren't "Frames". Unless you have an extension installed that is messing up your context menus ....
    http://support.mozilla.com/en-US/kb/Safe+Mode

Maybe you are looking for