Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JPanel prob  RSS feed

 
Mary Connolly
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With reference to the code below. I am trying to reference fields in FBCPanel from the PatientPanel. I have created a method in FBCPanel that returns the fields when called from PatientPanel. As I need to use the same instance as created in the main method below I was told I need to create a pointer from PatientPanel instance to FBCPanel instance. I was given the line below to do this (marked with a star). However, I am getting a symbol not recognised error because of it. I am using java 1.4. I cannot see any reference to setFieldPanel in Java Foundation classes in a Nutshell or Java in a Nutshell. Can anyone provide me with any assistance???
thanks alot!!!

import javax.swing.*;
public class BLOODS
{ public static void main (String[] args)
{ JFrame BloodsFrame = new JFrame ("Bloods");
BloodsFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JTabbedPane btp = new JTabbedPane();
PatientPanel ThisPatientPanel = new PatientPanel();
FBCPanel ThisFBCPanel = new FBCPanel();
* ThisPatientPanel.setFieldPanel(ThisFBCPanel);
btp.addTab("Patient Details", ThisPatientPanel);
btp.addTab("Full Blood Count", ThisFBCPanel);
//btp.addTab("Lipid Profile", new LipidPanel());
//btp.addTab("Urea & Electrolytes", new UreaElectroPanel());
BloodsFrame.getContentPane().add(btp);
BloodsFrame.pack();
BloodsFrame.show();
}
}
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setFieldPanel() isn't going to be in Java in a Nutshell or JFC in a Nutshell because this isn't a method in the APIs... it's going to be a method implemented directly in PatientPanel by whoever developed this class.
 
Eddie Vanda
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out this web page. However it is not simple and not pretty (to my eyes).
[ March 05, 2004: Message edited by: Eddie Vanda ]
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!