How to access the JTextfield on one panel from the button on the other pane

Hi to all!
I m having very simple problem about getText() and setText(). I am developing the user interface for an application. I got the JTextField on one panel and one button on other panel. When I try to do getText() and SetText() operation on the JTextField which is placed on a JPanel with the help of JButton click event Which is placed on other panel. The JTextField doesn't response. My program is not showing any compilation as well as runtime error. So how can i solve this problem?
Note: Duke dollar for rigth answer.
Thanks! in advance!

I've looked at the other post and was wondering what happened to all of those It is working briliantly...
In any event, I've taken the original code and clean it up my way as shown below:
import java.awt.event.*;
public class MainClass {
   public static void main(String[] args) {
      MajorFrame majorFrame = new MajorFrame();
      majorFrame.setSize(550,550);
      majorFrame.show();
      majorFrame.addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
            System.exit(0);
   }  //method ends
}  //class endss
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;
public class MajorFrame extends JFrame implements ActionListener {
   Container contentPane = getContentPane();
   Panel1 panel1 = new Panel1();
   JButton buttonMajorFrame = new JButton("Button MajorFrame");
   public MajorFrame() {
      contentPane.setLayout(null);
      contentPane.setSize(550,550);
      panel1.setBounds(5,5,400,250);
      contentPane.add(panel1);
      buttonMajorFrame.setBounds(5,350,150,20);
      buttonMajorFrame.addActionListener(this);
      contentPane.add(buttonMajorFrame);
   } //constructor ends
   public void actionPerformed(ActionEvent ev) {
      if (ev.getSource() == buttonMajorFrame) panel1.panel11.textField11.setText("majorFrame working");
   } //methode ends
} //class endss
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;
public class Panel1 extends JPanel {
   Panel11 panel11;
   Panel12 panel12;
   public Panel1() {
      panel11 = new Panel11();
      panel12 = new Panel12(panel11);
      setLayout(null);
      panel11.setBounds(5,5,200,50);
      add(panel11);
      panel12.setBounds(5,65,200,50);
      add(panel12);
   //end constructor
}//end classs
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;
public class Panel11 extends JPanel implements ActionListener {
   public JTextField textField11;
   JButton button11;
   public Panel11() {
      setLayout(null);
      textField11 = new JTextField();
      button11 = new JButton("Button 11");
      textField11.setBounds(5,5,120,20);
      add(textField11);
      button11.setBounds(5,25,120,20);
      button11.addActionListener(this);
      add(button11);
   } //constructor ends
   public void actionPerformed(ActionEvent ev) {
      if (ev.getSource() == button11) textField11.setText("Text11 working");
   } //method ends
} //class endss
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;
public class Panel12 extends JPanel implements ActionListener {
   JButton button12 = new JButton("Button 12");
   public Panel11 panel11;
   public Panel12(Panel11 panel11) {
      this.panel11=panel11;
      setLayout(null);
      button12.setBounds(5,5,120,20);
      button12.addActionListener(this);
      add(button12);
   }//constructor ends
   public void actionPerformed(ActionEvent ev) {
      if (ev.getSource() == button12) panel11.textField11.setText("Text12 working");
   }//method ends
}//class endssI think this is what you're looking for and hope it saves your rear end...hehehe!
;o)
V.V.

Similar Messages

  • I have 2 game centers on 1 Apple ID and it willl only access 1 of them may someone tell me how to access the other one

    I have 2 game centers on 1 Apple ID and it will only access 1 of them may someone tell me how to access the other one

    You don't have to use the same ID for iCloud as you do for purchasing.  You can just set up iCloud using your other ID. 
    If your have already have another account, you have to go to Settings>iCloud, tap Delete Account, choose Keep on My iDevice when prompted, set up your new account with the other ID, turn on your iCloud data syncing and when prompted, choose Merge to upload your data to the new account.

  • How to access the e-mails which are stored in different folders via Mac

    Hi guys, I am new to Mac. My problem is about the setting of Mac Mail.
    There are 8 folders with my hotmail account in order to automatically sort e-mail into folders. I only can get the e-mails of inbox folder via Mac Mail software. I am wondering how to access the other e-mails which are stored in other folders.
    Thanks a lot!

    I don't think that things have changed going from 10.5 Mail to 10.6 Mail in this regard (I need to log on to my laptop more often). So, assuming that my premise is correct, in the left hand column of the mail window, underneath your inbox, drafts, sent, trash, and junk mailboxes, there should be the descriptive name of your mail account, written in gray capital letters, with a gray triangle to the left of that name. If the gray triangle is pointing to the right, click on it so that it points downward. That will expand the account view of mailboxes on the server. You should be able to see all of the other folders.

  • How do i access the history pane

    upgraded today and cannot find how to access the history pane either directly or through a button on the navigation bar.
    need to know how to access it and how to add a button for it please.
    thank you

    You can display and hide the history sidebar using Ctrl+h
    To add a button to the toolbar, right-click next to the "+" (new tab) button or in a blank space after the address box, and choose Customize. Drag the button from the button palette to the desired location, then click Done.
    Any luck?

  • How to access the screen from one function group to other function group

    Hi Experts,
    How to access the the screen from one function group to other function group.
    Please help me on this , Bcoz it is client requirement i need to finish this urgently.
    Please
    Thanks
    Basu

    HI ,
    You can do a call transaction or submit and return
    Regards,
    Sooness.

  • How to access the ms access database in the JApplet?

    I am New here.
    Please help me.
    I am create one java file to access MS access the database in the JApplet.
    It say "Access denied".
    How to access the ms access database in the JApplet?
    Message was edited by:
    SVPRM

    Hi,
    First of all, were u successfull in creating the connection with the .mdb file.Like settting the DSN and configuring the .mdb file path in control panel.
    If yes then one option might be that the file ur trying to access is in Read-only mode.
    regards

  • How to access the photos on icloud

    hi
    how to access the photos which i saved in i cloud, from my iPhone 5,
    Note: i do not use any PC. and i only have purchased 20 GB of space on an annual sub. so as to save my photos, and create space in my phone and now i am unable to access it,
    please advise
    thanks
    xxv

    There isn't really a way to "save" photos to iCloud currently with non-beta software.
    iCloud is involved with photos in 2 ways -- backup and Photo Stream.
    Backup of an iOS device includes Camera Roll photos but they cannot be viewed at iCloud.com -- the backup can only be used when doing a restore of an iOS device.
    Photo Stream photos also cannot be viewed at iCloud.com; Photo Stream is designed as a method of transferring photos from one device to another and is not designed to store the photos. More info http://support.apple.com/kb/HT4486
    There is a new feature -- "iCloud Photo Library" -- coming sometime after the iOS 8 release next week: http://www.macrumors.com/2014/09/12/apple-demotes-icloud-photo-library-beta/

  • Nokia Lumia 928 apparently died after an attempted Windows 8.1 update.  Replacement phone arrived the next day.  How can I restore my contacts, photos, etc.?  Backup assistant is no help and I don't know how to access the Cloud.

    Nokia Lumia 928 apparently died after an attempted Windows 8.1 update.  Replacement phone arrived the next day.  How can I restore my contacts, photos, etc.?  Backup assistant is no help and I don't know how to access the Cloud.

    Did you have the phone set to backup things to the One Drive on Microsoft servers?

  • How to access the value of application item in javascript

    How to access the value of application item in javascript?

    Hi,
    One way
    var myVariable = '&MY_APP_ITEM.';Br,Jari

  • How to access the remote Objects Without Db_links?

    Hi ,
    I want to know how to access the remote objects without db_link.That is i want to access a object in some other server which has different database.

    SanjayBala, just so you know that it is possible to create a database link in Oracle to non-Oracle databases in some circumstances. Look up Generic Connectivity aslo know as Heterogenous Services. With 11g Oracle has basically renamed the feature and replaced it with somethinkg named ike DG4ODBC.
    I have not spent time studying the details for DB4ODBC but with HS Oracle provided the interface and you had to obtain the necessary ODBC driver on your own. I had Oracle on AIX reading and writing to SQL Server on Windows but the developers chose to write a java program and connect to both via it. On Windows and Linux platforms the necessary ODBC drivers might be available without the requirement to go out and purchase one.
    The Oracle Open Gateway product is an advanced version of the above features with drivers for specific non-Oracle databases included like DB2 or Informix.
    HTH -- Mark D Powell --

  • How to access the Text Frame, when we use scrollable frame,

    Hi Friends,
    How to access the Text Frame, when we use scrollable frame,
    Thank you,
    [ Nav ]

    That's the same question:
    how can I access something (a page item) on a page…
    Answer: you need something unique in that object you can get a handle on.
    Or you use the selection a user of your script is doing and work with that selection…
    A "scrollable frame" is nothing special. What it makes it a "scrollable frame" is the DPS software.
    So you have to look for attached labels on the object, that identify the object for the PDS plug-in "Overlay Creator" as a "scrollable frame". That's possible with the "extractLabel("KeyString")" function. But you need to know the appropriate key-string in advance.
    In another of your thread in the DPS forum, I basically answered the question how to obtain those key-strings.
    When knowing the key-string you could loop through all your page items (you can skip all text frames) in the allPageItems-collection, to identify the "scrollable frame" by extracting the right label.
    If you have more than one "scollable frames" you need a second unique identifier for the particular object.
    That could be nearly any property.
    Keep in mind, there is no "scrollableFrames" collection in the DOM !
    Uwe

  • How to access the Remote Appserver thru EJB

    hi friends...
    How to access the Remote appserver thru EJB from a Portlet.
    I've tried but its not working u have any idea Plz help me out...
    The scenario is I have my portal running in my machine & appserver(weblogic) running in remote and want to access that appserver
    thru Remote EJB from my portal. I have tried with the t3 protocol and iiop but it is not working
    The code i have use
    Properties props = new Properties();
    props.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    props.put(javax.naming.Context.PROVIDER_URL, "t3://10.1.87.46:7031");
    it is giving me a nullpointer exception when i try to access the method in the ejb , it is not able to call that method...
    Plz help me out to resolve this situation
    Thnx in Advance.....

    SanjayBala, just so you know that it is possible to create a database link in Oracle to non-Oracle databases in some circumstances. Look up Generic Connectivity aslo know as Heterogenous Services. With 11g Oracle has basically renamed the feature and replaced it with somethinkg named ike DG4ODBC.
    I have not spent time studying the details for DB4ODBC but with HS Oracle provided the interface and you had to obtain the necessary ODBC driver on your own. I had Oracle on AIX reading and writing to SQL Server on Windows but the developers chose to write a java program and connect to both via it. On Windows and Linux platforms the necessary ODBC drivers might be available without the requirement to go out and purchase one.
    The Oracle Open Gateway product is an advanced version of the above features with drivers for specific non-Oracle databases included like DB2 or Informix.
    HTH -- Mark D Powell --

  • How to access the System's Printer

    Hi,
    How to access the printer using java. Can any one give me a sample.
    Thanks in advance,
    Maheshwaran Devaraj

    http://java.sun.com/docs/books/tutorial/2d/printing/index.html

  • How to access the handle of  the Frame window ?

    How to access the handle of the frame window through out the application ?. I want to display an alert box, while I click the fifth inner child component of the Frame . I am using Dialog Class for the alert box, I have to pass the frame handle to the Dialog constructer, I am getting the handle of the frame by getParent().getParent()......getParent().. But can any one suggest any better solution.

    If you application extends Frame or JFrame, you could simply refer to "this", or if you create a global or final Frame object that you use as your "top-level" component, you could refer to it this way. Additionally, if you're ever in a situation where you really need to go all the way to the top through n levels of components, I believe you could always do something like this...
    // assume myContainer is the "child" component that you're on, and you want to find its top-level parent
    Container c = myContainer;
    while (c.getParent() != null) {
         c = c.getParent();
    }

  • I need to know how to access the book pod in robohelp 8/

    i need to know how to access the book pod in robohelp 8/

    Hi there
    Actually, by my count there are at least five ways to coax books into the TOC
    From the menu, Click File > New > Book.
    Type the keyboard shortcut of Ctrl+Shift+B.
    Right-click the pod and choose New > Book.
    Click the New Book icon in the pod toolbar.
    If you have organized your project using folders, you may automatically create a TOC based on the file structure and each folder becomes a book. There are also multiple ways to automatically create the TOC. One is by right-clicking the TOC pod. Another is by clicking an icon in the pod toolbar and another is by clicking the Tools menu.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

Maybe you are looking for

  • Track setup for multiple independent projects

    Hi, We have to develop two separate projects in NWDI. Both projects are Web Dynpro based, independent of each other and developed by different development teams. We need the ability to maintain and deploy the projects independently. What is the recom

  • HT3924 Using iMac as external display for PC.  Question re: Cables

    I have a PC laptop with an HDMI output, but not a mini displayport.  I have a 27" iMac with a mini displayport jack.  If I want to use the iMac as an external monitor for the PC laptop, can I use a mini displayport to HDMI cable?  Or does my laptop n

  • My Skype to Go Number Incompatible with Skype

    It's also happening to me. Around two month ago I started using MagicJack, everything works good with the phone, even when I call out US to my favorites/registered skype numbers works fine; but for no registered/favorite number I need to call through

  • IPv6 Connectivity limited ??

    I am wondering whether anyone can help me with this one please ? We have recently had massive problems with slow broadband speeds. We have home hub 1 so have had the hub for a while now and have never had a problem with speed until the last month or

  • Invalid Custom Page Rendering in Spaces

    Dear sirs, I have developed a very simple ADF Faces app - main page main.jspx with <af:outputText value="main page" id="ot1"/>. This page belongs to bounded task flow ADFSampleFlow. After deployment to weblogic all works fine - I can see this page an