473,416 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Can I access one object from another?

In my main class (really long), I create a Settings object (a JFrame) and a Game object.

What I would like to know is if it's possible to have that JFrame access methods in the Game object, without adding more methods to the main class.

For example:

Expand|Select|Wrap|Line Numbers
  1. public class Tester {
  2.  
  3.     public static void main(String[] args) {
  4.  
  5.         ClassA objectA = new ClassA();
  6.         ClassB objectB = new ClassB();
  7.  
  8.     }
  9.  
  10. }
  11.  
And then objectA can execute methods in objectB without having to call a method from Tester which then calls the method from objectB.
Oct 23 '10 #1
0 805

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Yoandy Rodriguez | last post by:
I'm developing a J2EE aplication and the project leader told me to investigate about the Data Access Object design pattern. I did some research at Sun's blueprints for the enterprise site but there...
0
by: Nir | last post by:
Hello All , I need to get access to another session object . It is possible ??? Thanks Nir
4
by: Sergey Atun | last post by:
Hi, How can I access object with a name like this: string ObjectName = "TextBox1"; TextBox(ObjectName).Text = "bla bla bla" Thanks.
1
by: Geraldine Hobley | last post by:
Hello I wish to create an Access Object of an already existing Access .mdb database. Below is how this is done in visual basic 6. Please tell me how to do this in visual basic.net. Dim objAccess...
5
by: Peter Olcott | last post by:
I created an object that requires access to another objects data, yet have found no good way to pass this data as a parameter because the member function that requires this data must be a binary...
5
by: dk9 | last post by:
I want to use Access Object Model from .NET to open access database files and change/add/delete Tables, Views, etc and to repair/compact Databases. MSDN is lacking this kind of information. ...
10
by: asdf1234234 | last post by:
My code is: -a.py- import b class A: def __init__(self): pass def my_method(self): var = 1 self.var = 2
0
by: ewokspy | last post by:
Is there any reason why I should not use the Access object model to manipulate an access database in C#? I've done a lot of VBA coding so I can move through that easier, but instinct says I should...
2
by: CoreyReynolds | last post by:
Hello all, I'm working with Access 2007 and my VB code is getting an error at: DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, _ strSourceName, strFileName, False ...
0
by: helloitsme | last post by:
Hello All! I am using access object to run a module in my access database. The module runs fine. However, the database does not get closed even though I have tried many things to...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.