InternalFrame.setNorthPane(null) and JDesktopPane outline drag mode

package components;
import javax.swing.JDesktopPane;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JMenuBar;
import javax.swing.JFrame;
import javax.swing.KeyStroke;
import java.awt.event.*;
import java.awt.*;
import javax.swing.plaf.basic.BasicInternalFrameUI;
* InternalFrameDemo.java requires:
*   MyInternalFrame.java
public class InternalFrameDemo extends JFrame
                               implements ActionListener {
    JDesktopPane desktop;
    Point mouseCoord, windowCoord = new Point();
    public InternalFrameDemo() {
        super("InternalFrameDemo");
        //Make the big window be indented 50 pixels from each edge
        //of the screen.
        int inset = 50;
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setBounds(inset, inset,
                  screenSize.width  - inset*2,
                  screenSize.height - inset*2);
        //Set up the GUI.
        desktop = new JDesktopPane(); //a specialized layered pane
        createFrame(); //create first "window"
        setContentPane(desktop);
        setJMenuBar(createMenuBar());
        //Make dragging a little faster but perhaps uglier.
        desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
    protected JMenuBar createMenuBar() {
        JMenuBar menuBar = new JMenuBar();
        //Set up the lone menu.
        JMenu menu = new JMenu("Document");
        menu.setMnemonic(KeyEvent.VK_D);
        menuBar.add(menu);
        //Set up the first menu item.
        JMenuItem menuItem = new JMenuItem("New");
        menuItem.setMnemonic(KeyEvent.VK_N);
        menuItem.setAccelerator(KeyStroke.getKeyStroke(
                KeyEvent.VK_N, ActionEvent.ALT_MASK));
        menuItem.setActionCommand("new");
        menuItem.addActionListener(this);
        menu.add(menuItem);
        //Set up the second menu item.
        menuItem = new JMenuItem("Quit");
        menuItem.setMnemonic(KeyEvent.VK_Q);
        menuItem.setAccelerator(KeyStroke.getKeyStroke(
                KeyEvent.VK_Q, ActionEvent.ALT_MASK));
        menuItem.setActionCommand("quit");
        menuItem.addActionListener(this);
        menu.add(menuItem);
        return menuBar;
    //React to menu selections.
    public void actionPerformed(ActionEvent e) {
        if ("new".equals(e.getActionCommand())) { //new
            createFrame();
        } else { //quit
            quit();
    //Create a new internal frame.
    protected void createFrame() {
        final MyInternalFrame frame = new MyInternalFrame();
        ((BasicInternalFrameUI) frame.getUI()).setNorthPane(null);   
        frame.setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));   
        frame.addMouseMotionListener(new MouseMotionAdapter() {
            public void mouseDragged(MouseEvent e) {  
                isMouse2Move(frame, e);               
        frame.addMouseListener(new MouseAdapter() {          
            public void mousePressed(MouseEvent e) {                                                 
                setWindowDragPoint(e);              
        frame.setVisible(true); //necessary as of 1.3
        desktop.add(frame);
        try {
            frame.setSelected(true);
        } catch (java.beans.PropertyVetoException e) {}
    private void isMouse2Move(Component frame, MouseEvent e) {
        int cur_type = frame.getCursor().getType();   
        if (cur_type >= Cursor.DEFAULT_CURSOR) {
            if (cur_type == Cursor.MOVE_CURSOR) {
                moveWindow(frame, e);                       
    private void moveWindow(Component frame, MouseEvent e) {
        int deltaX, deltaY;
        Point newMouseCoord = e.getPoint();
        deltaX = (int) (newMouseCoord.getX() - mouseCoord.getX());
        deltaY = (int) (newMouseCoord.getY() - mouseCoord.getY());
        frame.getLocation(windowCoord);
        windowCoord.translate(deltaX, deltaY);
        frame.setLocation(windowCoord);
    private void setWindowDragPoint(MouseEvent e) {
        mouseCoord = e.getPoint();
    //Quit the application.
    protected void quit() {
        System.exit(0);
     * Create the GUI and show it.  For thread safety,
     * this method should be invoked from the
     * event-dispatching thread.
    private static void createAndShowGUI() {
        //Make sure we have nice window decorations.
        JFrame.setDefaultLookAndFeelDecorated(true);
        //Create and set up the window.
        InternalFrameDemo frame = new InternalFrameDemo();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //Display the window.
        frame.setVisible(true);
    public static void main(String[] args) {
        //Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
package components;
import javax.swing.JInternalFrame;
import java.awt.event.*;
import java.awt.*;
/* Used by InternalFrameDemo.java. */
public class MyInternalFrame extends JInternalFrame {
    static int openFrameCount = 0;
    static final int xOffset = 30, yOffset = 30;
    public MyInternalFrame() {
        super("Document #" + (++openFrameCount),
              true, //resizable
              true, //closable
              true, //maximizable
              true);//iconifiable
        //...Create the GUI and put it in the window...
        //...Then set the window size or call pack...
        setSize(300,300);
        //Set the window's location.
        setLocation(xOffset*openFrameCount, yOffset*openFrameCount);
}how to move frame (JDesktopPane) <desktop> can not enable drag outline mode..
help me please!
thank you.

yes i want all the decorations.Then I have no idea what you are tying to do. Why are you getting rid of the title bar?
Dragging is supported automatically by clicking on and then dragging the title bar. If you want to customize the behaviour then you would need to look at the UI. Good luck.

Similar Messages

  • Cursor issues, stuck on click and drag mode.

    My cursor is stuck on click and drag mode.I assumed issue was faulty track pad. Purchased a magic mouse, and initially it was fine then the same issues started occurring. Is this a virus? Ran disk repair and permissions repair , no change.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you boot, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a Fusion Drive or a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, reboot as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • My iPhone 4s is locked in speaker mode where it tells me every time I touch a new app and it outlines the app I touch and requires me to touch the screen twice in order to advance. Please help me remove this setting

    My iPhone 4s is locked in speaker mode where it tells me every time I touch a new app and it outlines the app I touch and requires me to touch the screen twice in order to advance. Please help me remove this setting

    Explore Settings > General > Accessibility. Around page 128 of the User Guide is probably appropriate.
    The User Guide is available at http://support.apple.com/manuals/ or downloadable from iTunes as an iBook.

  • The HUD Inspector in Full Screen View seems to position at the right margin of the image as a default(?)  If I toggle the button in the top right of the HUD it 'unlocks' and I can drag it to where I prefer -- at the left margin; (for over a decade) my doc

    The HUD Inspector in Full Screen View seems to position at the right margin of the image as a default(?)  If I toggle the button in the top right of the HUD it 'unlocks' and I can drag it to where I prefer -- at the left margin; (for over a decade) my dock has resided at the right margin so all my slider manipulation over countless editing sessions in Aperture has been ingrained to work at the left margin -- but, the vast majority of the time, the HUD overlaps the image I am editing in this 'unlocked' mode. 
    Every occasionally I enter Full Screen View and it positions on the left margin *without* superimposition...(!) My great joy is modulated into aggravation, however, should my tracking cursor drift all the way 'out of bounds' -- to call in the hidden pane of adjacent images sequenced in the library... This dramatically shrinks the Full Screen display and re-locks the HUD; if I toggle the switch to re-xpand the image it re-positions at the right margin!!!!  I SOOoooooo wish I knew how to control the default 'locked' margin of the HUD in Full Screen View...

    Drag it over to the Left. Then lock it there.

  • Text Wont Show And I cant drag and drop

    ok well when I insert text it doesnt show but It shows what i written on the side. I have contact support their answer was they can't help me because I am trial verison. I am simply not going to buy a program if the trial verison is not working its that simple. Also When I try to drag and drop a picture a little circle apears with the line through it. I do have admin rights.

    Usually when you can not see text is is one of the following.
    1)Color of the text is the same color as the background
    2)there is a layer over top of the text blocking the text
    3)The opacity of the text layer is almost transparent (the opacity is less than 100%)
    4)A blend mode is applied to the text layer
    5)A layer style is applied to the text layer that either does 1, 2, or 4
    As far as draging and dropping, just drag the file from your respective file viewer and drop it on the background of photoshop (it will open the file assuming it is a file that photoshop can read)
    So verify that the file can be viewed in another app to make sure the file is not corrupt
    Make sure the file extention is one that photoshop supports. (in photoshop go to the menu and select File>Open, then find the text that says file type and click on the box next to it. That will drop down a list of supported file types. If it is not listed, it will not open)
    That being said there are time when it should work and don't, so if anything here does not work, post back and someone can help.
    By the way, it best to post what version of photoshop you have, what operating system you have and a screen grab of photoshop so we can see what you see. For future reference...

  • Movieclip stuck in "outlines" preview mode

    I'm using Flash CS4. Not sure how this happened, if it's a glitch or what, but somehow a movie clip within a site I was building has gotten stuck in the "outlines" preview mode. If I return to the root of the site, everything shows in "full" mode (just as flash is set to full in the view > preview mode options.) But when I double click to open one of the main movie clips, it's all outlines-- and the preview mode continues to show that "full" is selected.
    Is this a glitch? Or is there some keystroke or option somewhere that I'm missing to get this individual movie clip back into full preview mode?

    You're a genius, doc. That did the trick-- no idea how I got in that situation in the first place, but that worked. Shows how long it's been since I worked in flash :s
    Thanks again!

  • Using NULL and NOT NULL in prompted filters

    Dear all,
    While trying to grap the concept of prompted filters in sap bo web intelligence, I had a question whether why we cannot use NULL and NOT NULL while creating a prompted filters in our report.

    HI,
    'Is Null' and 'Not Null' are the predefined functions in webi which only eliminate the null values or considering only null values.
    'Is Null' and 'Not Null' are itself predefined functions that why you are not getting  prompts.
    Null values are standard across the databases so this is defined  as a function in webi to specific eliminate the null values.
    If something is not standard then there is option in the webi to use different operator with static values or with prompts.
    More more information on Null see the Null wiki page.
    Null (SQL) - Wikipedia, the free encyclopedia
    Amit

  • Not null and enable or disable  column in tabular form

    Hi,
    Using apex version 4.1 and working on tabular form.
    ACT_COA_SEGMENT_MAS is Master table
    and
    ACT_SEGMENT_VALUES_MAS is detail table
    I have entered 8 rows in master table and PARENT_SEGMENT_ID is column in master table which is null able. If i specified PARENT_SEGMENT_ID with value in master table then in detail table there is column PARENT_ID that should not be null and enable.
    How i can enable or disable column when in master table PARENT_SEGMENT_ID column is null then in detail table PARENT_ID column should disable and vice versa.
    I have created tabular form on Detail table. before insert into the tabular form Check in master table in first entry if PARENT_SEGMENT_ID is not null in first row of master table then in tabular form PARENT_ID should enable and not null able in corresponding to this first row id's lines in tabular form.
    Same should check for second row in master table if PARENT_SEGMENT_ID is not null then entered rows with PARENT_ID into tabular form corresponding to 2nd id in master table should not nullable and column should enable in tabular form.
    Thanks & Regards
    Vedant
    Edited by: Vedant on Jan 9, 2013 9:12 PM

    Vedant,
    You need to create you own manual tabular form and not use the wizard.
    Using APEX_ITEM api you should be build you own form and you will be able to control how you wan to display the rows. (See Link [Apex Item Help|http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_item.htm#CACEEEJE] )
    select case when PRIMARY_TABLE_COLUMN is null then APEX_ITEM.DISPLAY_AND_SAVE(3 , DETAIL_COLUMN ) else APEX_ITEM.TEXT(2,detail_column) end "ALIAS" from detail table
    Hope that help.
    Vivek

  • Connection ==null and Connection is closed, difference

    Hi experts,
    I wonder what are the differences between "Connection==null" and "Connection is closed"?
    I closed a connection on one JSP page after a bean has retrieved data. Then, on the same page I call another bean to connect to the database. Because the Connection object has been created earlier, therefore Connection is not NULL, but it is closed. So, the second bean has to initiate another connection(if I knew how to test the "closed" status)
    Is it true that if the Connection is closed, then it should become null?
    I think I must have make quite a few mistakes in above statement:). Please help. Thanks a lot.

    connection.isClosed() will tell you if the connection object is closed or not. If it is closed, then the connection object can be dropped because you will not be able to create any new statements from that connection object. Just recreate another connection to use when this occurs.

  • Is null and regular value in where ($variable)

    is there any polibility to create select depend on value in where ?
    select count(x) where y = $variablebut if variable is NULLit doesn't work cause must be IS NULL or IS NOT
    select count(x) where y is $variableIs there any posibility to make it working with null and regular variable?

    try:
    select count(x) from <yourtable> where nvl(y,<not_possible_value>) = nvl($variable,<not_possible_value>);where <not_possible_value> is a value that is not possible for column y.
    E.g. if y always is a positive number you could use the value -1.

  • Avoiding null and duplicate values using model clause

    Hi,
    I am trying to use model clause to get comma seperated list of data : following is the scenario:
    testuser>select * from test1;
    ID VALUE
    1 Value1
    2 Value2
    3 Value3
    4 Value4
    5 Value4
    6
    7 value5
    8
    8 rows selected.
    the query I have is:
    testuser>with src as (
    2 select distinct id,value
    3 from test1
    4 ),
    5 t as (
    6 select distinct substr(value,2) value
    7 from src
    8 model
    9 ignore nav
    10 dimension by (id)
    11 measures (cast(value as varchar2(100)) value)
    12 rules
    13 (
    14 value[any] order by id =
    15 value[cv()-1] || ',' || value[cv()]
    16 )
    17 )
    18 select max(value) oneline
    19 from t;
    ONELINE
    Value1,Value2,Value3,Value4,Value4,,value5,
    what I find is that this query has duplicate value and null (',,') coming in as data has null and duplicate value. Is there a way i can avoid the null and the duplicate values in the query output?
    thanks,
    Edited by: orausern on Feb 19, 2010 5:05 AM

    Hi,
    Try this code.
    with
    t as ( select substr(value,2)value,ind
            from test1
            model
            ignore nav
            dimension by (id)
            measures (cast(value as varchar2(100)) value, 0 ind)
            rules
            ( ind[any]=  instr(value[cv()-1],value[cv()]),
            value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
                                               and ind[cv()]=0     THEN ',' || value[cv()] END      
    select max(value) oneline
    from t;
    SQL> select * from test1;
            ID VALUE
             1 Value1
             2 Value2
             3 Value3
             4 Value4
             5 Value4
             6
             7 value5
             8
    8 ligne(s) sélectionnée(s).
    SQL> with
      2   t as ( select substr(value,2)value,ind
      3          from test1
      4          model
      5          ignore nav
      6          dimension by (id)
      7          measures (cast(value as varchar2(100)) value, 0 ind)
      8          rules
      9          ( ind[any]=  instr(value[cv()-1],value[cv()]),
    10          value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
    11                                             and ind[cv()]=0     THEN ',' || value[cv()] END 
    12          )
    13        )
    14   select max(value) oneline
    15   from t;
    ONELINE
    Value1,Value2,Value3,Value4,value5
    SQL>

  • Replacing NULL and EmptyString('') with "Unknown" in SSRS parameter dropdown

    All,
    What I want to do is, in the SSRS parameter drop down, instead of showing NULL and Blank values(), i want to categorize them as "Unknown", so, if the user selects "Unknown" from the SSRS drop down parameter, he should be able to see all
    the records that have NULL values or empty strings in that particular column in the result set.
    Can you tell me, how should I handle it in my main stored proc as well as in the dataset?
    Right now, i have something like this:
    Where
    (t1.name in (select value from dbo.Split(@TName,',')) OR @TName IN ('All'))
    -- Where t1.Name has empty strings and NULL values. Both of these values should be categorized under "Unknown"
    -- How would the dataset query look like? Right now I have this query for populating the drop down for that parameter:
    Select All
    UNION
    Select Distinct Name
    Order BY 1

    Hello,
    Please refer to the following stored procedure:
    SELECT
    CASE WHEN TName IS NULL OR TName = ''
    THEN 'Unknown' ELSE TName END AS TName
    From DemoTable
    Then, use following query code to get the parameter values:
    SELECT Distinct
    CASE WHEN TName IS NULL OR TName = '' THEN 'Unknown'
    ELSE TName END AS TName
    FROM DemoTable
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • NULL and Space value in ABAP

    Hi All,
           I like to know, is it NULL and Space value is same in ABAP, if it is not how to check null value.
    Thank you.
    Senthil

    everything is correct though some answers are not correct.
    A Database NULL value represents a field that has never been stored to database - this saving space, potentially.
    Usually all SAP tables are stored with all fields, empty fields are stored with their initial value.
    But: If a new table append is created and the newly-added fields do not have the 'initial value' marked in table definition, Oracle will just set NULL values for them.
    as mentioned: There is no NULL value to be stored in an ABAP field. The IS NULL comparison is valid only for WHERE clause in SELECT statement. WHERE field = space is different from WHERE field IS NULL. That's why you should check for both specially for appended table fields.
    If a record is selected (fulfilling another WHERE condition) into an internal table or work area, NULL values are convertted to their initial values anyway.
    Hope that sheds some light on the subject!
    regards,
    Clemens

  • NULL and SPACE

    Hello Gurus:
    I have had to use BOTH 'null' and 'space' (ofcourse I tried 'initial' too...) when selecting data from PRPS table, otherwise all the required records were not fetched. I had to do this on two different occassions. The first is a SAP provided field and the other is customer's enhancement. I have cut-paste the two code blocks. Any ideas why?
    Thanks in advance,
    Sard.
    ***********(1)**************
    select posid objnr func_area zzfunct from prps into
                    corresponding fields of table it_wbs
                              where func_area is null or
                                    func_area eq space.
    ************(2)**************
    select prps-pspnr prps-posid prps-post1
       into (wa_test1-pspnr, wa_test1-posid, wa_test1-post1,
       from prps
      where prps-posid in s_wbs and
            ...                 and
           ( prps-zzmlind is null or prps-zzmlind eq space ).
    append wa_test1 to it_test1.
    clear wa_test1.
    endselect.

    Hello Richard,
    the Requirement to check for NULL corresponds to the definition of the database (field) within the DDIC. Check the flag initialize (it has also some documentation).
    This flag is intended to be used if the definition of the db table is changed at SAP while the table already is used at customer side.
    After deploying the corresponding patch or upgrade such a changed definition may result into the need to convert all entries. For tables with many entries this would result into inacceptable downtime. So such changes are done without the initialiazation/conversion of existing entries.
    The tradeoff is the syntax you noticed.
    Kind regards
    Klaus

  • NULL and dynamic SQL

    If table testrh2 has the following columns and data
    col1 --> NULL
    col2 --> 2
    and table testrh has the following columsn and data
    col1 --> NULL
    How could I write a dynamic SQL statement to join on the nulls? I've written the following block as a starting point.
    declare
    cursor c1 is select col1 from isis.testrh;
    lval varchar2(1000);
    lval2 varchar2(1000);
    begin
    for r1 in c1 loop
    lval := 'select col2 from isis.testrh2 where col1 = '||r1.col1;
    execute immediate lval into lval2;
    dbms_output.put_line(lval2);
    end loop;
    end;

    You can't compare null values with '=' in Oracle SQL.
    Null can only be compared with <column> is null .
    You can see it when you try these two queries:
    select * from dual where null is null;  -- you will see one row
    select * from dual where null=null;  -- you will see no rowsThat's why you have to write something like
    (<column1>=<column1>   or   (<column1> is null and <column2> is null))This should also work with null:
    decode(<column1>,<column2>,1,0)=1By the way, why do you use dynamic sql?
    lval := 'select col2 from isis.testrh2 where col1 = '||r1.col1;
    I think you could replace your two lines ( lval:= ... AND execute immediate) by this:
    begin
      select col2
      into lval
      from isis.testrh2
      where decode(col1,r1.col1,1,0)=1;
      dbms_output.put_line('lval='||lval);
    exception
    when no_data_found then
      dbms_output.put_line('no data found'); -- or whatever you want
    end;Edited by: hartmutm on 02.10.2010 23:54

Maybe you are looking for

  • How to get the ServletContext when writing a class

    Morning, I've got a project using al least 4 jsp documents that try to manipulate a mysql database To access the database and get a connection, i've put this syntax at the start of each document <%! Connection con; %> <%      String url =  (String)ap

  • Create users and assigning them security on the Entity dimension

    Hi All, I'm working with Hyperion ESSBASE 11.1.1.3 and Hyperion Planning 11.1.1.3 and I have a problem related to create new users (without admin permissions) and assigning them security on the Entity dimension. When I access with these users to a Da

  • Routing number of operations and reference operation  in the order

    Hi experts, If anyone knows about Routing number of operations and reference operation  in Maintenance order , please explain. is it used for maintenance order? if yes, please mention the path from which I can see or note the number generated by the

  • Has the Process Version changed in LR 5.5?

    I have downloaded LR5.5 and have gone through a final selection of images for printing; most of these I had modified using LR 5.4. With 5.5 a fair number of the images showed a considerable degree of highlight clipping which was not apparent when pro

  • Log also when font is changed

    Hi all, I've a question. I've a trigger that logs informatiion when a user updates a template. (the information is written to a table. Now is it so that it only logs when the user updates someting, but it doesn't log when the user changes something o