How can I use internal frames with buttons to call others internal frames?

Hello.
I'm building a MDI-application using JFrames and several JInternalFrames, but I have problems.
A JFrame has JMenuBar with JMenu and JMenuItem. One of these, call the first JInternal that has its interface. In this interface has a button that call other type (a class extension of JInternalFrame) JInternalFrame.
When I clicked button happen a exception (java.lang.NullPointer).
What happening?
Help me, please.

What i usually do is to give my desktop to my internal frames. So within the internalframe, you can use your desktop and add other internal frames to it.
The code should look something like the following.
desktop = your JDesktopPane
MyInternalFrame = an InternalFrame
AnotherMyInternalFrame = another InternalFrame
public class MyInternalFrame extends JInternalFrame implements ActionListener
  private JButton jb = new JButton("Launch");
  private JLayeredPane desktop = null;
  public MyInternalFrame(JLayeredPane desktop)
    this.desktop = desktop;
    getContentPane().add(jb);
    jb.addActionListener(this);
  public void actionPerformed(ActionEvent ae)
    if (ae.getSource() == jb)
      desktop.add(new AnotherMyInternalFrame(desktop),JLayeredPane.DEFAULT_LAYER);
}

Similar Messages

  • How Can i use Html frames with  simple JSP???

    How Can i use Html frames with simple JSP???
    Actually i am creating an application in which i have used Index.html as frame.
    Noew i am trying that if i click on a link of one frame(say menu frame) the \result shoul come to some other frame(say frame named mainwindow).
    Hoe can i do like this???
    Anand Pritam

    Well i am using..
    < Base target="mainwindow">
    But it is no working is there some other way??

  • How can i use my iphone with more than one itunes

    how can i use my iphone with more than one itunes

    Sync iPod/iPad/iPhone with two computers
    Although it isn't possible to sync an Apple device with two different libraries it is possible to sync with the same logical library from multiple computers. Each library has an internal ID and when iTunes connects to your iPod/iPad/iPhone it compares the local ID with the one the device normally syncs with. If they are the same you can go ahead and sync...
    I have my library cloned to a small 1Tb USB drive which I can take between home & work. At either location I use SyncToy 2.1 to update the local copy with the external drive. Mac users should be able to find similar tools. I can open either of the local libraries or the one on the external drive and update the media content of my iPhone. The slight exception is Photos which normally connects to a specific folder on a specific machine, although that can easily be remapped to the current library if you create a "Photos" folder inside the iTunes Media folder so that syncing the iTunes folders keeps this up to date as well. I periodically sweep my library for new files & orphans with iTunes Folder Watch just in case I make changes at one location but then overwrite the library with a newer copy from the other. Again Mac users should be able to find similar tools.
    As long as your media is organised within an iTunes Music or Tunes Media folder, in turn held inside the main iTunes folder that has your library files (whether or not you let iTunes keep the media folder organised) each library can access items at the same relative path from the library folder so the library can be at different drives/paths on different machines. This solution ensures I always have adequate backups of my library and I can update my devices whenever I can connect to the same build of iTunes.
    When working with an iPhone earlier builds of iTunes would remove any file not physically present in the local library, even if there was an entry for it, making manual management practically redundant on the iPhone. This behaviour has been changed but it will still only permit manual management with a library that has the correct internal ID. If you don't want to sync your library between machines on a regular basis just copy the iTunes Library.itl file from the current "home" machine to any other you want to use, then clean out the library entries and import the local content you have on that box.
    tt2

  • How can I use an iPad with two itunes accounts?

    How can I use an iPad with two itunes accounts?
    Hi there
    My partner has a works iPad, which has her works Apps on (ones that are specifically made by her company and are NOT available in the App store).
    What I want to be able to do is to ALSO have my itunes account on there so that I can put all the apps I have purchased previously from my iPhone on it.
    This is so I can put on VLC player (thats already in my itunes account) so I can add videos to the iPad.
    How do I do this please?
    I tried it before by connecting it to my mac, but it wiped everything off the iPad completely and also deleted the data settings for using 3G.
    So I want to avoid this happening again the future as it had to be sent back to her head office to be sorted again.
    Any advise please?
    Thanks

    You can't. The iPad is desgined to be a 'one user' device and only really works with one apple ID at a time.
    The only way would be if she, at work and with her work apple id, downloaded your apps (repurchasing them of course).
    It's not meant to be a multiple user/multiple ID device.

  • How can i use text expander with the new Mavericks,

    how can i use text expander with the new Mavericks,

    I regret upgrading to mavericks for the same reason
    ftamez wrote:
    how can i use text expander with the new Mavericks,
    Now I have been searching - and you have to buy an app and it will cost you $34.99 (what a rip off)

  • How can i use "icloud backup" with ios 4.2.1?

    How can i use "icloud backup" with ios 4.2.1? I tried to update my ihpone 3G wih the newest IOs. Seems not to be possible.

    You cannot.
    It requires ios 5.
    Your iphone can only go to 4.2.1

  • How can I use the NI PXI-6508 with Lab View 7? what are the first steps to get started??How can I use the channels with lab view 7????

    I have a 8 slot PXI system with 2 NI PXI 6508 and 1 DMM 4070 in it. I want to get started with programming the digital I/O cards (6508)! How can I use this cards with LabView 7?what is the best way to get started, or where can I get examples showing how to use the several channels?
    Thanks!
    Philipp

    Philipp,
    The best way to get started is to decide if you want to use traditional NI-DAQ or NI-DAQmx. Recently we released NI-DAQ 7.1 which provides NI-DAQmx support for the PXI-6508. In my opinion, NI-DAQmx is more efficient and much easier to use.
    To get started with examples, simply launch LabVIEW and go to Help>>Find Examples. Then expand Hardware Input and Output>>DAQmx and select the appropriate digital group for your application. This should help get you started.
    Please repost if you need addition assistance. Good luck with your application!

  • How can I use the DBAdapter with SequencingPollingStrategy in OSB Cluster?

    Hi!
    I have a OSB cluster. I need to read a view with the DBAdapter. I use SequencingPollingStrategy to implement the adapter.
    Then I import it into OSB and make it work and the service works normally in the single node.
    But if I import it into OSB cluster, the service always read the duplication records from the view.(the Distrbute polling is not worked in SequencingPollingStrategy )
    So how can I use the DBAdapter with SequencingPollingStrategy in OSB Cluster?
    Thank you!

    Nope. Version 5 is a fashion accessory: it looks like software, but it doesn;t actually do anything. Sort of like a sports car with a lawn-mower engine. Looks snzzy. Doesn't really work. (And given how buggy it is, I should further specifiy that the lawn-mower engine comes with a blade: it chews up your old templates, produces files that cannot be sent as email attahcments [yes, really], and—this just in—doesn;t play well with the new SMB facility of Mavericks. In short, as one reviewer put it, "un unmitigated disaster."

  • How can i use MS word with MAVERICK

    how can i use MS word with MAVERICK?  None of the MS Office applications work with new IOS!!!

    What version of Microsoft Office Mac are you running?  You probably just need to update it to the latest release:
    http://www.microsoft.com/mac/downloads?pid=Mactopia_Office2011
    Office 2011 Mac's latest version is 14.3.8 for instance.

  • How can one use Mission Control with two monitors?  Please bring Spaces back

    How can one use Mission Control with two monitors.  With Spaces I could treat each space as a single desktop.
    SyBB

    I use two monitors at work and have no issue. I have my mail set to use Desktop 1 and iTunes set to the second monitor of Desktop 1. I have browsers set to Desktop 2 and Fusion and RDC set to Desktop 3.
    Two things that may help you. In System Preferences > Mission Control, disable the setting "Automatically rearrange spaces...". This screwed with assigning applications to certain spaces. And the other thing is don't use full screen on apps that support it. This just makes your second monitor superfluous.

  • How can I use Local SPAN with RSPAN ??

    How can I use Local SPAN with RSPAN ??
    I want to mirror traffics from ISP-A and ISP-B to Anomaly-detector module.
    so I had configured like this...
    C6500-A
    vlan 1000
    name RSPAN
    remote-span
    monitor session 10 source interface Gi5/1 - 2 rx
    monitor session 10 destination remote vlan 1000
    monitor session 20 destination anomaly-detector-module 3 data-port 1
    monitor session 20 source remote vlan 1000
    interface GigabitEthernet1/13
    switchport
    switchport trunk encapsulation dot1q
    switchport trunk allowed vlan 1000
    switchport mode trunk
    no ip address
    C6500-B
    vlan 1000
    name RSPAN
    remote-span
    monitor session 10 source interface Gi5/1 - 2 rx
    monitor session 10 destination remote vlan 1000
    interface GigabitEthernet1/13
    switchport
    switchport trunk encapsulation dot1q
    switchport trunk allowed vlan 1000
    switchport mode trunk
    no ip address
    end
    but it was not working..
    it wasn't any change of input packet hit count when
    I'd enter a command 'show anomaly-detector module 3 data-port 1 traffic'
    was upper configuration wrong..?
    Can I use VACL configuration ?

    try to change "monitor session 10 destination remote vlan 1000 " to "monitor session 10 destination anomaly-detector-module 3 data-port 1 " on C6500-A

  • How can i use jpg extension with forms 10g and webutil

    I have a form with webutil and i want to open imege jpg extension but thier are Bmp but my
    image jpg and image item has no jpg extension .
    How can i use jpg extension with forms 10g and webutil ?

    You can use the JFIF image format for jpg files.

  • How can i use 3D Features with 256 VRAM

    How can i use 3D Features with 256 VRAM

    Well, in theory you *could* install Photoshop CS6 version 13.0 and not update it.
    Is your video card replaceable?  They don't cost that much.
    -Noel

  • How can I use the ScrollTablePane with kodo ?

    How can I use the ScrollTablePane with kodo, taking a result Query as
    a Collection and throw it into the ScrollTablePane , if it not possible ,
    Is there a Component which I can do it ?
    Thanks , Marco Aurelio.

    Marco-
    I am not familiar with any "TableScrollPane" classes. Can you clarify
    whether this is some 3rd party custom component, or something you have
    written?
    Note that we do not provide any pre-build graphical data components with
    Kodo, but we do intend to provide some examples in the future.
    In article <cl1hn7$9ep$[email protected]>, Marco Aurelio Bueno wrote:
    >
    How can I use the TableScrollPane with kodo, taking a result Query as
    a Collection and throw it into the ScrollTablePane , if it not possible ,
    Is there a Component which I can do it ?
    Thanks , Marco Aurelio.--
    Marc Prud'hommeaux
    SolarMetric Inc.

  • How can I use the TableScrollPane with kodo

    How can I use the TableScrollPane with kodo, taking a result Query as
    a Collection and throw it into the ScrollTablePane , if it not possible ,
    Is there a Component which I can do it ?
    Thanks , Marco Aurelio.

    Marco-
    I am not familiar with any "TableScrollPane" classes. Can you clarify
    whether this is some 3rd party custom component, or something you have
    written?
    Note that we do not provide any pre-build graphical data components with
    Kodo, but we do intend to provide some examples in the future.
    In article <cl1hn7$9ep$[email protected]>, Marco Aurelio Bueno wrote:
    >
    How can I use the TableScrollPane with kodo, taking a result Query as
    a Collection and throw it into the ScrollTablePane , if it not possible ,
    Is there a Component which I can do it ?
    Thanks , Marco Aurelio.--
    Marc Prud'hommeaux
    SolarMetric Inc.

  • How can i use iTunes 10 with my ipad that has ios7

    how can i use iTunes 10 with my ipad that has ios7

    jpbblues wrote:
    how can i use iTunes 10 with my ipad that has ios7
    You cannot. You need iTunes version 11 for iOS 7.
    iTunes free download from www.itunes.com/download

Maybe you are looking for

  • AppleTV will no longer play movies

    I have been using AppleTV for years now and have loved it...till now! I've purchased lots (over 200) of movies through iTunes and watch them on my AppleTV.  The movies are streaming from the iTunes service (via Internet), NOT from a computer running

  • FlexUnit Ant task freeze at Reciving Data...

    Hello, I'm trying to use flex unit task and when I run it, get this on console and stay there for ever. "*****" is just to privacy this is my ant task <target name="UNIT TEST">                     <echo>COMPILING TEST SWF..</echo>                    

  • DB adapter polling issue-urgent

    Hi , I am trying to poll for new or changed records from DB table using a DB adapter. I used a DB adapter with Poll for new or changed records in a table operation type and used a bpel process to write the changed records in a file adapter(using writ

  • How to handle runtime error in PreUUT step when running in Parallel mode

    I would like to run Test UUTS in parallel mode, and some actions are done in PreUUT such like read serial number and fixture control. The process model won't goto PostUUT Step when runtime error occurs in PreUUT step, so i would like to add some acti

  • More response time

    when program execute at time my program takes more response time so what is reason.