How to set a limit on the size of a JDesktopPane?

I have a JDesktopPane inside a JFrame, with a JInternalFrame inside the JDesktopPane. I want to give a maximum size to the JDesktopPane so that when i drag/move the internalframe, it doesnt go off the JDesktopPane screen.
I know many people uses ScrollBars to solve this but i dont want to use them & set a limit with boundaries of the JdesktopPane.
When users drag/move the internalframe towards the edge of the JDesktopPane, i want it to stick to the edge, like the effect of moving somthing over and you hit a wall.
Better example: Move a tetris block to the left wall and you hit the wall so it sticks to the wall and wouldn't allow you to move further left..
Tried "setMaximumSize(..)" but that didnt work.
After some googling and research, reading of web material i came up with following code:
Gives a new DesktopManager to the JDesktopPane & override the DragFrame method... but found that this method is not even getting called :S
//all gui setup code here
desktopPane.setDesktopManager(new DefaultDesktopManager() {
               private static final long serialVersionUID = 1L;
               public void dragFrame(JComponent f, int x, int y) {
                 if (f instanceof JInternalFrame || f instanceof JInternalFrame.JDesktopIcon) {
                   Dimension d = frame.getSize();  //desktopPane.getSize();
                     System.out.println(d.getWidth() + " " +  d.getHeight()); //just to see if it reaches here..
                      if (x < 0) {
                               x = 0;
                   else {
                     if (x + f.getWidth( ) > d.width) {
                                       x = d.width - f.getWidth( );
                   if (y < 0) {
                                 y=0;
                   else {
                     if (y + f.getHeight( ) > d.height) {
                                   y = d.height - f.getHeight( );
                 super.dragFrame(f, x, y);
             });I though that this method gets called automatically once you drag the internalframe.

[http://forums.sun.com/thread.jspa?threadID=5246887]
db

Similar Messages

  • How to set a limit on the number of processes a session can start?

    I have an Oracle db version 10.2.0.4 running on Solaris 10. My parallel_max_servers parameter is set to 650 and the processes parameter is set to 700. But I don see one session that is spawning 129 processes and another one that is spwaning 65 processes. Is there a way to limit the number of processes that a session can spawn?

    check processes
    $ ps -ef | grep $ORACLE_SID|wc -l
    SQL> select * from v$resource_limit where resource_name ='processes';
    My parallel_max_servers parameter is set to 650 and the processes parameter is set to 700.
    PARALLEL_MAX_SERVERS
    specifies the maximum number of parallel execution processes and parallel recovery processes for an instance. As demand increases, Oracle increases the number of processes from the number created at instance startup up to this value.
    Do you use query with parallel?
    example:
    -> create table xxx PARALLEL (degree 5)
    -> select /*+ PARALLEL
    if you don't use parallel on execution processes... so, your processes not increase ;)
    By the way your db have limited proceses= 700 (Dedicated Server Processes)

  • How do I set a limit to the number of registrants to an event form?

    How do I set a limit to the number of registrants filling out an event form?

    PLEASE add this feature. as far as I can tell there are no option out there that serve this need. FormAssembly, EmailMeForm, or FormsCentral. Think of how many customers would use this. Imagine a t-shirt company that pre-prints inventory, wouldn't they want to limit how many forms could be submitted that want a size L shirt? My business is participant based, like the evnt question above we need to limit the number of participants. Of course I could program my own solution, but then I would miss out on all the other cool FormsCentral features. Any chance this could be added right away if I sponsored it as a custom development?

  • Is there a limit on the size of the input for the Solve Linear Equations block?

    Hello,
    I'm trying to figure out why the Solve Linear Equations block will properly function with some sets of data and why it won't with others. What my program is doing is taking a signal and comparing it with a batch of sine and cosine waves to try and pick out patterns in the data. I have different sample sizes and it seems to work when I throw 3900 points at it. However, I have another set with 4550 points and it gives me incorrect amplitudes for my sinusoids.  Is there some limit to the size of the matrices that I can give this block? Or is there some other workaround that still allows me to keep all of my data?
    Thanks,
    David Joseph

    Well, the best way to show what I expect is to see the entire program. It's pretty evident that when looking at the graphs, something isn't right. What is supposed to happen is that the runout amplitudes are found, and then those sinusoids are subtracted from the initial data, leaving tooth to tooth data and noise. When I use the larger arrays, it seems as though not all of the data gets through (count the peaks on the product gear runout graph vs. initial) and the amplitudes are much to small, such that nothing is really taken out and the tooth to tooth data looks like the initial data.
    Also, we will also be using an FFT, but it will be limited to only determining the frequencies we should check. I've fought with the fft blocks quite a bit and I just prefer to not use them. Plus, the guy I'm writing this for wants exact answers and does not want to pad or resample the data or use windows.
    The exact number of data points isn't important (ie. 4550 vs 4551) since I use the array size block to index the for loop.
    As for typical values, they can change a lot based on materials. But, the original 3900 data point sets and the 4550 data point sets used practically identical gears. So, use the original 3900 sets I've included as references (check the RO array block numbers to compare).
    I've included 3 3900 samples, 3 4550 samples, and 3 4550 samples that have been truncated to 3900 or so as constants on the block diagram.
    Also, the check for additional runouts (like 3 per rev, 4 per rev, etc..) is optional, but if you choose to use it, use positive integers only.
    I don't know how much of this program will make sense and I have wires running everywhere.. so good luck. Keep in mind I'm only a student and I hadn't touched Labview until about 2 or 3 months ago.
    Thanks,
    David Joseph
    Attachments:
    Full example.vi ‏139 KB

  • DeserializeJSON - is there a limit on the size of the JSON data that can be converted?

    I have some valid JSON data that's being converted successfully by DeserializeJSON... until it gets to a certain size, or that's certainly what appears to be happening.  The breaking point seems to be somewhere in the neighborhood of 35,000 characters... about 35KB.  When the conversion fails, it fails with a "JSON parsing failure: Unexpected end of JSON string" message.  And when the conversion fails, the JSON data is deemed to be valid per tools like this one:  http://www.freeformatter.com/json-validator.html.
    So, is there a limit on the size of the JSON data that can be converted by DeserializeJSON?
    Thanks!

    Thanks Carl.
    The JSON is being submitted in its entirety, confirmed by Fiddler.  And it's actually being successfully saved to a SQL Server nvarchar(MAX) field too.  I can validate that saved JSON.
    I'm actually grabbing the JSON to convert directly from the SQL Server, and your comments / thoughts led me down the path of resolution.
    Turns out that the JSON was being truncated prior to getting to the DeserializeJSON command, but it was the cfquery pull that was doing the truncating.  The fix was to enable "long text retrieval (CLOB)" for this datasource in CF Admin.  I'd never run into that before or even knew that this setting existed.
    Thanks again for your comments!

  • How to set white spaces between the fields in dataset??

    Hi all,
    I am writing a set on information to from infotypes to a text file. Its a fixed width file. How do set white spaces in the fields for dataset?
    Example:
    TYPES: begin of header,
                    filler(40)  type c,
                    id(3)        type c,
                    filler2(7) type  c,
                    delimiter  type  c,
                 end of header.
    DATA header type header.
    header-filler1 = ' '.
    header-id       = '100'.
    header-filler2 = ' '.
    header-delimiter = cl_abap_char_utilities=>newline.   ( do it to get a new line)
    my_table = header.
    append my_table.
    DATA: out_file(256) type C,
          codepage_ref type ref to CX_SY_CONVERSION_CODEPAGE,
          out_char type c,
          size type i,
          insert_string type string,
          insert_size type i.
      out_file = filename.
      open dataset out_file for output in text mode ENCODING NON-UNICODE.
      LOOP AT my_table.
        size = strlen( my_table ).
        insert_string = ''.
        DO size TIMES.
          offset = sy-index - 1.
          try.
              out_char = my_table+offset(1).
              IF out_char = SPACE.
                CONCATENATE insert_string '' INTO insert_string SEPARATED BY SPACE.
              ELSE.
                CONCATENATE insert_string out_char INTO insert_string.
                transfer insert_string to out_file NO END OF LINE .
                insert_string = ''.
              ENDIF.
            catch CX_SY_CONVERSION_CODEPAGE.
              insert_size = strlen( insert_string ) - 1.
              insert_string = insert_string(insert_size).
          endtry.
        ENDDO.
       transfer CL_ABAP_CHAR_UTILITIES=>NEWLINE TO out_file NO END OF LINE.
      ENDLOOP.
      close dataset out_file.
    How do I get to insert the space for filler1 and filler2?
    Edited by: Siong Chao on Oct 4, 2011 4:56 AM
    Edited by: Siong Chao on Oct 4, 2011 8:27 AM
    Edited by: Siong Chao on Oct 4, 2011 8:29 AM

    problem lies in the open dataset codes
    Used:
    open dataset out_file for output in text mode encoding non-unicode message msg.
    if sy-subrc= 0.
    loop at my_table.
    transfer my_table to out_file
    transfer cl_abap_char_utilities=>newline to out_file no end of line.
    endloop.

  • How to set approvals limit in SRM.

    Hello Experts.
    I would like to know how to set approval limit in SRM. I know in R/3 it is done at release startegy level. We will have class and rerlease strategies with number of characteristics and it will be subjected to approval.
    But I would like to know how it is handled in SRM. and also I would like to know it is varies with respect to scenarios (Classic, extended classic)  or same for all the scenarios?
    Kindly help me to understand.
    Thanking you
    Regards
    Sharan

    Hello Sharan,
    Approval limit is managed with "Extended attributes" tab, radio-button "PO Value limits" for Organizational Unit (object 'O') or Position (object 'S'). This is for all SRM releases and you can use it for all document category wokflow.
    Then, in SRM 7.0 (don't remember for lower releases), use method GET_APPROVAL_LIMIT from class interface /SAPSRM/CL_WF_RULE_CONTEXT.
    Regards.
    Laurent.

  • Is there a way to set a limit on the number of characters each cell will hold in numbers?

    Hi there, I'm creating a CSV file via Numbers and would like to set a limit to the number of characters a cell will hold in numbers. This way, when I copy text from my source, and paste it into the numbers cell, the text will be cut off at the character limit I've placed for that cell.
    Specifically, I would like my character limit per cell in a column on a new spreadsheet to be 100 characters. I have text to copy & paste into roughly 10 different cells and I'd like it to all be 100 characters.
    I am using Numbers version 9 of iWork and 10.7.5 OS.
    Any help is appreciated.

    Thank you t quinn for your reply as I do really appreciate the help.
    I don't quite understand what your suggestion was and before I try to figure it out and play around with numbers, I thought I should clarify further. When i wrote I want to paste the content into the cell and have it limited to 100 characters I was mis-spoken. I actually have all the content already in the columns in a spreadsheet and would now like to just limit some of the columns to hold only 100 characters in a cell so that when its a CSV file it will be accepted to the program I'm trying to upload it to.
    SO does that change the way you can answer my question?
    Is there a way to just limit the content currently in a spreadsheet to 100 characters per cell?
    Kindly

  • Is there a limit on the size of Exchange mailbox?

    One of my user has 8Gb of data stored on the Exchange server mailbox. (Yes, on the server, not local pst)
    Since ipad can store up to 1,000 recent messages, is there is limit on the size of 1,000 emails to be stored locally on the iPad, assuming the user has a 64Gb New iPad?

    no

  • Is there a limit on the size of SDHC card that can be read with the iPad camera connectioin kit?

    Is there a limit on the size of SDHC card that can be read with the iPad camera connection kit?

    I've successfully connected 32 gig SDHC and CF cards so if there is an upper limit, it's at least 32 gig.
    I know SDXC will not work.
    With the cards that don't work, have they been formatted correctly? the camera connection kit will only read cards holding images. (Well, it'll only see the images) And those images have to have a file name of exactly 8 characters (DSC_2342 for example) and they  have to be in a folder named DCIM.
    Anything else it wont' read.
    I put a photo on there called 'Christmas' and the connection kit won't see it. I put a photo on there in the DCIM folder named XMAS2342 it'll see that.
    So it's possible that those cards weren't read because they weren't speaking the right language.

  • How can I check and change the size of photo or doc in iPhone or any other app

    How can I check and change the size of photo or doc in iPhone or any other app

    You would need software form a third party to have this option.  The free software that comes with the 8600 doesn't have an option for that. Vuescan is the only software I could find that says it works with your pritner and has a descreen option.  You have to purchase it, but it will give you more advanced options than the software that came with the printer.
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------

  • How to set a song in the playlist to be phone ringtone

    how to set my song in the playlist to be my ringtone

    you have to convert it to a ringtone first. searching google will give you many ways to do it. also, there are some ringtone apps with pros and cons to each one. you cannot just pick a song on your phone and make it a ringtone unfourtunately.

  • How to set a cookie in the browser from an html page called via an Iview

    How to set a cookie in the browser from an html page called via an Iview
    Hello all,
    I have an issue which is causing problems. I have a snap survey (html form with submit and cookie setting) which is embedded in a url iview.
    Although the submit and the form work fine, the portal will not allow the cookie to be set it seems.
    Is there a way to allow cookies to be set from an embedded page in a url iview??
    You will make my day if you know!
    System: EP7 SP13
    Kind regards
    Alex

    Hi,
    Check this:
    http://www.oracle.com/technology/products/ias/portal/html/same_cookie_domain_with_pdkv2.html
    Cookie Basics
    Web browsers have built in rules for receiving and sending cookies. When a browser makes a request to a web server and the web server returns cookies with the response, the browser will only accept a cookie if the domain associated with the cookie matches that of the original request. Similarly, when a browser makes a subsequent request, it will only send those cookies whose domain matches that of the target web server.
    These rules are designed to ensure that information encoded in cookies is only "seen" by the web server(s) that the originator of the cookie intended. These rules also ensure that the cookie cannot be corrupted or imitated by another server. By default, the domain associated with a cookie exactly matches that of the server that created it. However, it is possible to modify the domain at the time the cookie is created. Relaxing the cookie domain increases the scope of the cookie's visibility making it available to a wider "audience" of web servers.
    For example, if a cookie is created by a.us.oracle.com, it's domain will usually be set to a.us.oracle.com. This means that the browser will only send the cookie to a.us.oracle.com. It will never send it to any other servers. However, if at the time of creation, the domain of the cookie is set to .us.oracle.com, the browser will send the cookie to any server whose domain falls within .us.oracle.com. such as portal.us.oracle.com, provider.us.oracle.com, app.us.oracle.com etc
    Regards,
    Praveen Gudapati

  • TS4006 how to set a tracking from the computer if someone stolen the ipod

    how to set a tracking from the computer if someone stolen the ipod

    Welcome to the Apple Community.
    You can only locate your device when it is logged into iCloud and 'Find My Phone' is enabled, additionally the device will need to be switched on and connected to a wifi or cellular network.
    Unfortunately, you cannot activate iCloud or 'Find My Phone' remotely.

  • How to set Where clause in the View Object of the MessageChoice ?

    Hi,
    How to set Where clause in the View Object of the
    MessageChoice ?
    Example:
    <bc4j:rootAppModuleDef name="EdEscolaCampusView1AppModule"
    definition="ed00050.Ed00050Module"
    releaseMode="stateful" >
    <bc4j:viewObjectDef name="EdEscolaCampusView1" >
    <bc4j:rowDef name="CreateEdEscolaCampusView1" autoCreate="true" >
    <bc4j:propertyKey name="key" />
    </bc4j:rowDef>
    </bc4j:viewObjectDef>
    <bc4j:viewObjectDef name="ListaTipLocalView1"
    rangeSize="9999">
    </bc4j:viewObjectDef>
    </bc4j:rootAppModuleDef>
    </bc4j:registryDef>
    messageChoice declaration:
    <bc4j:messageChoice name="SeqTipoLocalCampus"
    attrName="SeqTipoLocalCampus"
    prompt="Local do Campus">
    <contents>
    <bc4j:optionList attrName="SeqTipoBasico"
    textAttrName="NomTipoBasico"
    voName="ListaTipLocalView1"/>
    </contents>
    </bc4j:messageChoice>
    I would like set where clause of ViewObject, with dinamic parameters (using attribute1 = :1), before populate messageChoice.
    thanks...
    Danilo

    Hi Andy,
    I try set a where clause using the message:
    Set where Clause parameter using UIX , but my UIX Page have 2 messageChoice's of different ViewObject's, then I need implement this Java Class:
    //Nome da Package da Tela Detail
    package br.com.siadem.siaed.ed00050;
    // Importa as Bibliotecas necessárias
    import oracle.jbo.ViewObject;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.client.Configuration;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.servlet.event.PageEvent;
    import oracle.cabo.servlet.event.EventResult;
    import oracle.cabo.data.jbo.servlet.bind.*;
    import oracle.cabo.ui.data.BoundValue;
    import oracle.cabo.ui.data.DataBoundValue;
    import javax.servlet.http.HttpServletRequest;
    import br.com.siadem.siaed.util.*;
    import javax.servlet.http.Cookie;
    import oracle.cabo.data.jbo.def.NestedAppModuleDef;
    import oracle.cabo.data.jbo.def.ViewObjectDef;
    import oracle.cabo.data.jbo.def.AppModuleDef;
    // Classe que configura os parametros para a execução da Query,
    // utilizando variáveis de Sessao
    public class FunPreQueryLista
    public static EventResult FunConfiguraQuery(BajaContext context, Page page, PageEvent event) throws Throwable
    // TrataDadosSessao - Classe utilizada para retornar os valores das variáveis de sessão genéricas
    // Ex: CodCliente, CodMunicipio etc...
    TrataDadosSessao varDadosSessao = new TrataDadosSessao();
    // 1o. Parametro Configurado - Através da classe TrataDadosSessao, utilizando um método Get
    // <alterar>
    String valor1 = varDadosSessao.getCodCliente();
    String valor2 = varDadosSessao.getCodMunicipio();
    //Cria o objeto que retorna o ApplicationModule
    ApplicationModule am = ServletBindingUtils.getApplicationModule(context);
    // Início das Configurações da Query da Lista
    //Cria o objeto que retorna o view object da lista desejada
    //alterar
    ViewObject TipoLocal = am.findViewObject("ListaTipoLocalView1");
    //Configuração dos parametros definidos na query do view Object
    //alterar
    TipoLocal.setWhereClauseParam(0,valor1);
    TipoLocal.setWhereClauseParam(1,valor2);
    // Executa a Query
    TipoLocal.executeQuery();
    // Fim das Configurações da Query da Lista
    // Início das Configurações da Query da Lista
    //Cria o objeto que retorna o view object da lista desejada
    //alterar
    ViewObject TipoDestLixo = am.findViewObject("ListaDestinoLixoView1");
    //Configuração dos parametros definidos na query do view Object
    //alterar
    TipoDestLixo.setWhereClauseParam(0,valor1);
    TipoDestLixo.setWhereClauseParam(1,valor2);
    // Executa a Query
    TipoDestLixo.executeQuery();
    // Fim das Configurações da Query da Lista
    // Retorna o Resultado para a Página
    return new EventResult(page);
    The code works very well...
    And, I'm sorry for my two repost's in UIX Forum about this in a few time.
    Thank very much...
    Danilo

Maybe you are looking for

  • Oracle 7.3 import to Oracle 8i Enterprise Edition

    Due to data file block corruption we had to install Oracle 8i in NT. After successful installation we tried importing 7.3.4 data to 8i, after importing table data it seeems the import process got hung, the CPU usage shows 100% and the application see

  • Inconsistent results in default macros with Product exclusion/ Inclusion.

    Hi All, I have a default macro - Macro I,  that is required to be executed for a set of products, so have given a generic condition as ACT_PRODUCT( 9AMATNR) CP 12XX*, ( reqd to run for all the products of 12 XX series.) totally we have around 10 such

  • Firewire File Transfer Problem/  Dual Drive G4 to iMac

    Bought a new iMac. My old G4 (OSX10.3.9) has two internal HDs (30Gb & 40GB <my startup>) but only 30Gb drive shows up in target mode. Can't mount 40 Gb drive on iMac desktop to do file transfer when G4 is in "Target" mode? Called Apple "help" and was

  • FCC error

    Hi , I am doing file to file using FCC (txt - xml).here am getting below error.Please find and let me know the solution.   <SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>   <SAP:P1>com/sap/xi/tf/_MM_EmpDetails_</SAP:P1>   <SAP:P2>com.sap

  • Report parameter textboxes and execute button is missing. Date Model works.

    Hello, I created a BI Publisher Data Model. Did the testing of it by generating XML sample data. The data model requires 3 parameters as input. All worked fine for generating the XML. When I now create a report with a .rtf template that uses the data