Help on connection between windows

Hi guys! I'm novice in the java language and I want to ask you for help on one issue. I've created a class ClassContainer out of wich I've created two JFrame objects (Two frames with green background and a button OK inside). I can't figure what to write so that when I click the OK button of one of the frames the other frame comes on the screen. I've read about listeners and the actionPerformed() method of the ActionListener interface but I still can't solve the problem.
Any help will be appreciated. Thank you in advance!
P.S. And here is the code of the three classes
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class ContainerClass{
public static class ThePane extends JPanel {
public void paintComponent(Graphics g) {
super.paintComponent(g);
setBackground (Color.GREEN);
}// end of method paintComponent
} // end of class ThePane
public static class TheFrame extends JFrame {
public TheFrame (ThePane p) {
JButton button = new JButton("OK");
setContentPane(p);
add(button);
setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
setVisible(true);
setSize(500,300);
} //end of constructor
} // end of class TheFrame
} // end of class ContainerClass
====================================================================
import java.awt.*;
import javax.swing.*;
public class NewObject {
     public static void main (String[] args) {
     ContainerClass.TheFrame window = new ContainerClass.TheFrame (new ContainerClass.ThePane());
} // end of main
} // end of class NewObject
=====================================================================
import java.awt.*;
import javax.swing.*;
public class NewObject2 {
     public static void main (String[] args) {
     ContainerClass.TheFrame window2 = new ContainerClass.TheFrame (new ContainerClass.ThePane());
} // end of main
} // end of class newObject2

I'm sorry, but I wouldn't fix what you have now as it may not be fixable. You may want to go through the Sun Swing tutorials each lesson in turn as this will show you exactly what you want to do, but by first teaching you the necessary rudiments of Swing. Good luck!

Similar Messages

  • Easy connection between Windows Vista and OS 10.4?

    Is there an easy way to connect a Windows Vista laptop to a G5 running OS10.14?
    Seems my Vista can see my Mac, but connection is refused. I've turned on everything I can think of to enable sharing. Both computers can use the Internet using a router which is connected to a cable modem.
    Surely there must be a straightforward method of connecting, without needing a dictionary of computer jargon and a PhD in networking?

    Hi Stu,
    Have you tried logging into the Mac from the PC with the Mac's Username & the Mac's Password?

  • Connection between Windows XP & Mac OS X very slow

    Hi,
    I have a custom server running on a Windows XP SP2, using jre1.6.0_01. When I connect to this server with a client running on another Windows OS, the ServerSocket.accept() method returns successfully & rapidly. However, when the same client is run on a Mac OS X 1.4.9 using jre1.5.0_07, the server takes about 20 seconds to accept the connection, which is an unacceptable period of latency in my production environment. Is it due to a compliance issue between the two vendors of the JRE? Should I install the Sun JRE on the Mac OS X client (if it is possible)? Is there another way to get this to work efficiently?
    Here are the system properties of my server:
    java.runtime.name: Java(TM) SE Runtime Environment
    sun.boot.library.path: C:\java\jre1.6.0_01\bin
    java.vm.version: 1.6.0_01-b06
    java.vm.vendor: Sun Microsystems Inc.
    java.vendor.url: http://java.sun.com/
    path.separator: ;
    java.vm.name: Java HotSpot(TM) Client VM
    file.encoding.pkg: sun.io
    sun.java.launcher: SUN_STANDARD
    user.country: CH
    sun.os.patch.level: Service Pack 2
    java.vm.specification.name: Java Virtual Machine Specification
    user.dir: C:\java\transmediaco\lib
    java.runtime.version: 1.6.0_01-b06
    java.awt.graphicsenv: sun.awt.Win32GraphicsEnvironment
    java.endorsed.dirs: C:\java\jre1.6.0_01\lib\endorsed
    os.arch: x86
    java.io.tmpdir: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\
    line.separator:
    java.vm.specification.vendor: Sun Microsystems Inc.
    user.variant:
    os.name: Windows XP
    sun.jnu.encoding: Cp1252
    java.library.path: C:\WINDOWS\system32;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Autodesk\Backburner\;C:\Program Files\Java\jdk1.5.0_09\bin;C:\ffmpeg;C:\Program Files\QuickTime\QTSystem\
    java.specification.name: Java Platform API Specification
    java.class.version: 50.0
    sun.management.compiler: HotSpot Client Compiler
    os.version: 5.1
    user.home: C:\Documents and Settings\administrateur
    user.timezone:
    java.awt.printerjob: sun.awt.windows.WPrinterJob
    file.encoding: Cp1252
    java.specification.version: 1.6
    java.class.path: properties-displayer.jar
    user.name: administrateur
    java.vm.specification.version: 1.0
    java.home: C:\java\jre1.6.0_01
    sun.arch.data.model: 32
    user.language: fr
    java.specification.vendor: Sun Microsystems Inc.
    awt.toolkit: sun.awt.windows.WToolkit
    java.vm.info: mixed mode, sharing
    java.version: 1.6.0_01
    java.ext.dirs: C:\java\jre1.6.0_01\lib\ext;C:\WINDOWS\Sun\Java\lib\ext
    sun.boot.class.path: C:\java\jre1.6.0_01\lib\resources.jar;C:\java\jre1.6.0_01\lib\rt.jar;C:\java\jre1.6.0_01\lib\sunrsasign.jar;C:\java\jre1.6.0_01\lib\jsse.jar;C:\java\jre1.6.0_01\lib\jce.jar;C:\java\jre1.6.0_01\lib\charsets.jar;C:\java\jre1.6.0_01\classes
    java.vendor: Sun Microsystems Inc.
    file.separator: \
    java.vendor.url.bug: http://java.sun.com/cgi-bin/bugreport.cgi
    sun.io.unicode.encoding: UnicodeLittle
    sun.cpu.endian: little
    sun.desktop: windows
    sun.cpu.isalist:And here are the system properties of my client:
    java.runtime.name: Java(TM) 2 Runtime Environment, Standard Edition
    sun.boot.library.path: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Libraries
    java.vm.version: 1.5.0_07-87
    awt.nativeDoubleBuffering: true
    gopherProxySet: false
    java.vm.vendor: "Apple Computer, Inc."
    java.vendor.url: http://apple.com/
    path.separator: :
    java.vm.name: Java HotSpot(TM) Client VM
    file.encoding.pkg: sun.io
    user.country: FR
    sun.os.patch.level: unknown
    java.vm.specification.name: Java Virtual Machine Specification
    user.dir: /Volumes/Stockage/lib
    java.runtime.version: 1.5.0_07-164
    java.awt.graphicsenv: apple.awt.CGraphicsEnvironment
    java.endorsed.dirs: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/endorsed
    os.arch: ppc
    java.io.tmpdir: /tmp
    line.separator:
    java.vm.specification.vendor: Sun Microsystems Inc.
    os.name: Mac OS X
    sun.jnu.encoding: MacRoman
    java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
    java.specification.name: Java Platform API Specification
    java.class.version: 49.0
    sun.management.compiler: HotSpot Client Compiler
    os.version: 10.4.9
    user.home: /Users/admin
    user.timezone:
    java.awt.printerjob: apple.awt.CPrinterJob
    file.encoding: MacRoman
    java.specification.version: 1.5
    java.class.path: properties-displayer.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/.compatibility/14compatibility.jar
    user.name: admin
    java.vm.specification.version: 1.0
    java.home: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home
    sun.arch.data.model: 32
    user.language: fr
    java.specification.vendor: Sun Microsystems Inc.
    awt.toolkit: apple.awt.CToolkit
    java.vm.info: mixed mode, sharing
    java.version: 1.5.0_07
    java.ext.dirs: /Library/Java/Extensions:/System/Library/Java/Extensions:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext
    sun.boot.class.path: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/ui.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/laf.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/sunrsasign.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jsse.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jce.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/charsets.jar
    java.vendor: Apple Computer, Inc.
    file.separator: /
    java.vendor.url.bug: http://developer.apple.com/java/
    sun.io.unicode.encoding: UnicodeBig
    sun.cpu.endian: big
    mrj.version: 1040.1.5.0_07-164
    sun.cpu.isalist: Your help is appreciated
    -Jerome

    I'm not sure if Mac is affected, but this could be the slow connect bug
    in JDK 1.5: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5092063
    Fixes are: upgrade to Java 6, or add a reverse DNS mapping to your
    name server, or (I don't know if this applies to the Mac) start the program
    with "java -Dsun.net.spi.nameservice.provider.1=dns,sun TheProgram".

  • Network connection between Windows and Manac?

    Hi,
    I have a Macbook and desktop PC both connected to the internet in the same home. I was wondering if it would be possible to transfer files from my PC to my Mac and if so how.
    Thanks,
    David

    Hello,
    Please try and search the forums before posting, as the topic of sharing files between Macs and PCs have been covered hundreds of times in this forum. You can save yourself time in getting the answers yourself rather than waiting for a response.
    These links should get you started. You can also find instructions in your Mac own built in Help files accessible via the Help menu.
    http://www.ifelix.co.uk/tech/leopard.html
    http://www.ifelix.co.uk/tech/windowsxp.html
    http://docs.info.apple.com/article.html?path=Mac/10.5/en/8201.html

  • Remote Desktop Connection between Windows Mobile 6.5 and server 2012

    Hi all,
    We have problem with remote desktop connection. The server that I want to connect is 2012 R2.
    We have no trouble with server 2008. I searched from internet, there are solutions on server side(I am not sure if these suggestions solve the problem), but our customers don’t want to solve this problem
    on server side because it is diffucult and risky.
    Is there a solution on handheld terminal side to do?
    Operating system: WM 6.5 classic(Professional o.s. has no effect, same error continues)
    Any help will be appreciated from your side.
    With Best Regards.

    Hi,
    What is the precise error message you are seeing?  What are the exact symptoms?
    I don't remember what version of RDP/featureset is supported by Windows Mobile 6.5.  Perhaps the client does not support Network Level Authentication, which is required by default on Server 2012 R2.  You can enable non-NLA connections by
    unchecking Allow connections only from computers with Network Level Authentication in Server Manager -- RDS -- Collections -- Properties of collection -- Security tab.
    Lack of NLA may not be the cause of the issue you are experiencing, however, if it is the only way to solve it would be to change the server setting or to potentially install a new client on the device that supports NLA.
    -TP

  • Yet Another Help! Connecting to Windows 2000

    Hello all, I see this is a popular topic. Got the latest 60 gig ipod and my Windows 2000 SP4 with the latest ipod updater and itunes. All of this and the program simply won't recognize my ipod. Windows sees it as a generic usb harddrive and that's it. ipod won't see it nor itunes doesn't. Thought it might be the ipod but I plugged it into my XP laptop and it works seamless. Any hope for Windows 2000 users? I already did the support page process but it didn't provide any help
    Any help would be great
    thanks
    PC   Windows 2000  

    Your macs name is set in sharing preferences, and will also appear in the AD configuration tab.
    Applications\utilities\directory access
    Unlock, click the services tab.
    Check the box next to Active Directory.
    Click Configure, and enter the appropriate information.

  • Help ! - Connection between airport extreme and airport express

    I have a home network with an iBook connecting wirelessly to an aiport extreme base station and an iMac connecting through an Airport Express, which has been configured as a relay to the base station (extending its range). The iMac is on the fourth/attic floor of my house; the iBook on the main floor.
    The iMac has a printer attached to it; the iBook does not.
    I have only intermittently been able to "see" the printer from my iBook and to print to it. Simiarly, i have only been intermittently been able to pull files from the iMac on to the iBook. I have no trouble connecting to the internet with either machine.
    Why does the network keep dropping the airport-express-connected imac (and printer)? what can i do? help!

    Sounds like an interferance problem to me. Do you have a cordless phone? You can try changing the channel on the AEBS or enable internet robustness.

  • Help me decide between Windows Vista Ultimate and Windows XP Pro

    I have an iMac 24", 2.8GHz w/4GBRAM.
    I really only plan on playing some of the latest games on my Windows partition, but I also want to get the very best performance out of some of the games.
    If DX10 means a loss of performance, than maybe I should stick with Windows XP?
    The games I mostly play are:
    Flight Sim X
    Bioshock
    COD4: Modern Warfare
    a Few racing sims
    NeverWinter Nights 2
    Civ IV
    Farcry and Crysis
    Based on those games... which Windows OS would perform best on my iMac?!

    Hi,
    up to now I have avoided Vista mainly because another 130 Euros is not in my budget right now.
    And since both my Macs don't have DX10 capable graphics cards I have no need for it.
    Vista does have other improvements than DX10 inside, but DX10 is sure to be the standard for future games, so why go with a Windows that doesn't support it and most likely never will.
    Games running under DX10 are indeed more demanding than under DX9 so it is also most likely that you will have a at least slightly lesser performance.
    A real test for any system is Crysis and Unreal Tournament 3 at the moment and we will see more in the future.
    So if I have to choose right now I would go for Vista.
    Regards
    Stefan

  • Help in connecting between two frames using button click

    hi all
    am a student doing my final year project work. i would like to know how to redirect from frame to frame. like in the button click i should get redirected to a new frame. please help........
    Message was edited by:
    jayalekshmy.r

    thanks for the reply. in sockets the previous frame wil be there after redirection. i dont want tht frame to be there. i only want the new frame to be displayed after redirection. how can i do the same so. plaese help

  • Howto connect a windows client oracle on a linux serveur 9i

    Hi all,
    I just want help for connecting one windows (2000 Pro) oracle client to a linux (Red Hat 8) oracle serveur. Thanks for all

    Well, the first step is to configure TNS. The Net Configuration Assistant will help you there if your DBA hasn't already set things up for you (sent you a tnsnames.ora file, pointed the client at a shared tnsna,es.ora file, set up OID, etc).
    Once you can tnsping the database from a command prompt, you can set up your ODBC DSN, assuming you want to use ODBC to connect.
    Justin

  • OEL5 guest os connectivity to Windows XP host os

    Hi Guys,
    need your help regarding connection between OEL5 and WinXP. The OEL5 was installed using Virtual PC 2007 and the WinXP is the host os.
    i successfully installed the OEL5 and now i want to connect it to my host os. i already disabled the firewall on both os and both of them are using dynamic ipaddress. Also the network setting on my virtual pc is the physical network adapter of my pc.
    did i miss something?
    Regards,
    Benjo

    the network setting of the virtualisation software (MS virtual pc here) is what you should look into.
    in general, desktop virtualisation software has the following options:
    -NATed network, the IP address of the host is shared with the VM
    -Bridged network, the VM tries to obtain it's own IP address besides the host
    -Local only network, the VM gets an DHCP address which is only visible to the host it runs on
    for your situation, bridged and local only could work.

  • Trying to Hot Sync Visor Pro with Windows 7 (64 bit OS) - getting error: "The connection between your handheld computer and the destktop could not be establishe​d. Please check your setup and try again."

    Hi.
    I read the posting regarding the options on Hotsyncing for Windows 7; however, I have some questions as I have a 64-bit system.
    I have a Visor Pro that I'm trying to Sync up with my new laptop which is running Windows 7.
    Steps I have taken:
    * installed the Visor Palm Desktop 3.0.1 that came with the Visor (which the installation went well)
    * The issue arises when I push the "Sync" button on the cradle and the following error message appears "The connection between your handheld computer and the destktop could not be established.  Please check your setup and try again."
    Since I have a 64-bit OS it appears that I have 2 options: 1) bluetooth or 2) Infrared.
    I have to admit I don't know know how to do either of these (how can I tell if this Handspring Visor Pro has bluetooth (which I don't it does)?). 
    Then how about the Infrared option?  I see on the PDA it has a red area that one can "beam" info.  Is this the same as Infrared or my 2nd option?
    I love my Visor and want to continue using it, but need to backup the valuable info!
    Any help with this would be greatly appreciated!
    THANKS!!!!!
    Post relates to: Visor Pro

    Hello lwalbring and welcome to the Palm forums.
    Your Visor, as you suspect, does not have Bluetooth, so you must use the IR HotSync option.  Since you are using Windows 7 64-bit, I believe that you are going to have to upgrade to Palm Desktop 6.2.2 to make things work from an OS/Driver perspective.
    Since you are using such an old device, you are also going to have to download and install the PalmHotSyncSetup Utility from Pimlico.  This update turns on support for old Palm OS PDAs in Palm Desktop 6.2.2.  Without the update, you won't be able to sync your Visor with Palm Desktop 6.2.2.  The software is free and the link is all the way at the bottom of the screen.
    Lastly, if your PC doesn't have an IR port on it, you will need to purchase a USB to IR adapter.  Some laptops still have IR ports and most desktops don't.
    Once you have all the pieces, you'll want to go back to the Windows 7 and Vista HotSync thread again, and follow the directions for setting up and configuring IR HotSyncs.
    Alan G

  • Cable Connection Between Two Computers in Windows XP

    Hi,
    I want to set up a direct Cable connection between 2 computers in Windows XP. Please, help me in this issue.
    Thabks

    hi,
    There is a guide about your issue, check it:
    http://support.microsoft.com/kb/305621

  • HT3986 I installed windows 7 to my macbook pro, but my mousepad does not work in windows 7 and also i can not connect my windows 7 to projector, but i can use my macbook's mouse pad and i can connect my mac to projector,so please help me for windows 7 pro

    I installed windows 7 to my macbook pro, but my mousepad does not work in windows 7 and also i can not connect my windows 7 to projector, but i can use my macbook's mouse pad and i can connect my mac to projector,so please help me for windows 7 problem

    i try to download now, do you think when i download and install the windows support software, can i fix the problem?

  • TS1538 i need help because i need help getting my ipod touch to connect to windows vista and

    i need help getting my ipod touch to connect to windows because it keeps saying udb device not recognized and i tr\]ied restarting the settings!!!!!

    Have you tried here:
    iOS: Device not recognized in iTunes for Windows

Maybe you are looking for

  • Java applet won't load from Jar file

    Hi all, I have a problem which I didn't used to have. I have written an applet which used certain classes stored in directories. It used to work just fine. I recently updated the main class from which the applet starts and since then I get error mess

  • Bash 'rename' utility different in Arch & Ubuntu

    The rename command in bash on my ubuntu box allows for Perl regular expressions for mass renaming of files: Synopsis:  rename perlexpr [ files ] The rename command in Arch bash is a more simple one: Synopsis: rename from to [ files ] Is it possible t

  • A Exception about :Tow -phase txns not allowed

    I meet the excepiton like below: java.rmi.ServerException: Could not obtain JDBC Connection from datasource: DataSource2; nested exception is:      java.sql.SQLException: ITS-7004: Two-phase txns not allowed with JDBC java.sql.SQLException: ITS-7004:

  • Keychain Sync not working with .mac.

    This is really strange. Everytime i do a .mac sync, latest items get deleted from my keychain (i am using login keychain). To see what was happening, i have done a reset sync data for keychain with 'replace data on .mac with sync info from this compu

  • Checking strings

    can you please help me check a string to make sure that all characters in the string are alphabetic. Ive tried: - String name = "neil"; char[] charsList = name.toCharArray();//makes a list of characters for (int loop = 0; loop < charsList.length; loo