Actionlistener in different class then the button

hello,
i am stuck on this piece of code and i think somebody here will be able to help me out :).
i have these classes.
ButtonPanel, Test.
in the buttonpanel i have a few buttons, but the actionlistener is an innerClass in Test.
when i want to add one of my actionlisteners in my ButtonPanel class the compiler cannot resolve symbol.
this is a snippet of code:
the buttons in buttonpanel class:
btnStart = new JButton("Start");
btnStart.addActionListener(new startActionListener());
btnStop = new JButton("Stop");
btnStop.addActionListener(new stopActionListener());
btnTest = new JButton("Test");
btnTest.addActionListener(new testActionListener());The actionlisteners in Test class:
public class startActionListener implements ActionListener{
public void actionPerformed(ActionEvent e){
java.awt.Toolkit.getDefaultToolkit().beep();//werkt niet
public class stopActionListener implements ActionListener{
public void actionPerformed(ActionEvent e){
java.awt.Toolkit.getDefaultToolkit().beep();//werkt niet
public class testActionListener implements ActionListener{
public void actionPerformed(ActionEvent e){
java.awt.Toolkit.getDefaultToolkit().beep();//werkt niet
}so basically its just how do use actionlisteners in the class that extends from the JFrame, in stead of in de ButtonPanel class where the buttons are?

URgent help need.
i need to link the page together : by clicking the button on the index page.
it will show the revelant class file. I have try my ationPerformed method to the actionlistener, it cannot work.
Thanks in advance.
// class mtab
// the tab menu where it display the gui
import javax.swing.*;
import java.awt.*;
public class mtab {
private static final int frame_height = 480;
private static final int frame_width = 680;
public static void main (String [] args){
JFrame frame = new JFrame ("Mrt Timing System");
frame.setDefaultCloseOperationJFrame.EXIT_ON_CLOSE);
frame.setSize(frame_width,frame_height);
JTabbedPane tp = new JTabbedPane ();
tp.addTab("Mrt Timing System", new sample());
frame.setResizable(false);
frame.getContentPane().add(tp);
frame.setSize(680,480);
frame.show();
// index page
// class sample
import java.awt.*;
import java.awt.event.*;
import java.awt.Image;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import java.text.*;
import javax.swing.border.*;
class sample extends JPanel implements ActionListener
//button
private JButton TimingButton;
private JButton ViewButton;
private JButton FrequencyButton;
private JButton calculateButton;
private CardLayout mycard;
private JPanel SelectXPanel;
private JPanel SelectYPanel;
private JPanel SelectZPanel;
private JPanel bigFrame, mainPane;
// constructor
public sample() {
super(new BorderLayout());
//create the object
//create button and set it
TimingButton = new JButton("MRT Timing Calculator");
TimingButton.addActionListener(this);
ViewButton = new JButton("View First and Last Train");
ViewButton.addActionListener(this);
FrequencyButton = new JButton("Show the Train Frequency");
FrequencyButton.addActionListener(this);
// Layout
//Lay out the button in a panel.
JPanel buttonPane = new JPanel(new GridLayout(3,0));
buttonPane.add(TimingButton);
buttonPane.add(ViewButton);
buttonPane.add(FrequencyButton);
// Layout the button panel into another panel.
JPanel buttonPane2 = new JPanel(new GridLayout(0,1));
buttonPane2.add(buttonPane);
tfrequency x = new tfrequency();
fviewl2 y = new fviewl2 ();
timing z = new timing ();
JPanel SelectXPanel = new JPanel(new GridLayout(0,1));
SelectXPanel.add(x);
JPanel SelectYPanel = new JPanel(new GridLayout(0,1));
SelectYPanel.add(y);
JPanel SelectZPanel = new JPanel(new GridLayout(0,1));
SelectZPanel.add(z);
// Layout the button by putting in between the rigid area
JPanel mainPane = new JPanel(new GridLayout(3,0));
mainPane.add(Box.createRigidArea(new Dimension(0,1)));
mainPane.add(buttonPane2);
mainPane.add(Box.createRigidArea(new Dimension(0,1)));
mainPane.setBorder(new TitledBorder("MRT Timing System"));
// x = new tfrequency();
// The overall panel -- divide the frame into two parts: west and east.
JPanel bigFrame = new JPanel(new GridLayout(0,2));
bigFrame.add(mainPane, BorderLayout.WEST);
//bigFrame.add(x,BorderLayout.EAST); // this is where i want to link the page
// this page being the index page. there being nothing to display.
add(bigFrame);
//Create the GUI and show it. For thread safety,
public void actionPerformed (ActionEvent e){
if (e.getSource() == TimingButton ){
JPanel bigFrame = new JPanel(new GridLayout(0,2));
bigFrame.add(mainPane, BorderLayout.WEST);
bigFrame.add(SelectZPanel,BorderLayout.EAST);
add(bigFrame);
else if (e.getSource() == ViewButton ){
JPanel bigFrame = new JPanel(new GridLayout(0,2));
bigFrame.add(mainPane, BorderLayout.WEST);
bigFrame.add(SelectYPanel,BorderLayout.EAST);
add(bigFrame);
else if (e.getSource() == FrequencyButton ){
JPanel bigFrame2 = new JPanel(new GridLayout(0,2));
bigFrame.add(mainPane, BorderLayout.WEST);
bigFrame.add(SelectXPanel,BorderLayout.EAST);
add(bigFrame);
// Train Frequency Page
// class fviewl2
import java.awt.*;
import java.awt.event.*;
import java.awt.Image;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import java.text.*;
import javax.swing.border.*;
class fviewl2 extends JPanel implements ActionListener
//Labels to identify the fields
private JLabel stationLabel;
private JLabel firstLabel;
private JLabel lastLabel;
//Strings for the labels
private static String station = "MRT Station:";
private static String first = "First Train Time:";
private static String last = "Last Train Time:";
//Fields for data entry
private JFormattedTextField stationField;
private JFormattedTextField firstField;
private JFormattedTextField lastField;
//button
private JButton homeButton;
private JButton cancelButton;
private JButton calculateButton;
public fviewl2()
super(new BorderLayout());
//create the object
//Create the Labels
stationLabel = new JLabel(station);
firstLabel = new JLabel (first);
lastLabel = new JLabel (last) ;
//Create the text fields .// MRT Station:
stationField = new JFormattedTextField();
stationField.setColumns(10);
stationField.setBounds(300,300,5,5);
//Create the text fields // First Train Time:
firstField = new JFormattedTextField();
firstField.setColumns(10);
firstField.setBounds(300,300,5,5);
//Create the text fields //Last Train Time:
lastField = new JFormattedTextField();
lastField.setColumns(10);
lastField.setBounds(300,300,5,5);
//Tell accessibility tools about label/textfield pairs, matching label for the field
stationLabel.setLabelFor(stationField);
firstLabel.setLabelFor(firstField);
lastLabel.setLabelFor(lastField);
//create button and set it
homeButton = new JButton("Home");
//homeButton.addActionListener(this);
cancelButton = new JButton("Cancel");
cancelButton.addActionListener(this);
calculateButton = new JButton("Get Time");
// Layout
//MRT Station Label // insert into the panel
JPanel StationPane = new JPanel(new GridLayout(0,1));
StationPane.add(stationLabel);
//MRT Station input field // insert into the panel
JPanel StationInput = new JPanel(new GridLayout(0,1));
StationInput.add(stationField);
//Get Time Button // insert into the panel
JPanel GetTime = new JPanel(new GridLayout(0,1));
GetTime.add(calculateButton);
//Lay out the labels in a panel.
JPanel FlabelL = new JPanel(new GridLayout(0,1));
FlabelL.add(firstLabel);
FlabelL.add(lastLabel);
// Layout the fields in a panel
JPanel FFieldL = new JPanel(new GridLayout(0,1));
FFieldL.add(firstField);
FFieldL.add(lastField);
//Lay out the button in a panel.
JPanel buttonPane = new JPanel(new GridLayout(1,0));
buttonPane.add(homeButton);
buttonPane.add(cancelButton);
// Layout all components in the main panel
JPanel mainPane = new JPanel(new GridLayout(4,2));
mainPane.add(StationPane);
mainPane.add(StationInput);
mainPane.add(Box.createRigidArea(new Dimension(0,1)));
mainPane.add(GetTime);
mainPane.add(FlabelL);
mainPane.add(FFieldL);
mainPane.add(Box.createRigidArea(new Dimension(0,1)));
mainPane.add(buttonPane);
mainPane.setBorder(new TitledBorder("View First and Last Train"));
JPanel leftPane = new JPanel(new GridLayout(1,0));
leftPane.add(Box.createRigidArea(new Dimension(0,1)));
leftPane.add(mainPane);
leftPane.add(Box.createRigidArea(new Dimension(0,1)));
JPanel hahaFrame = new JPanel(new GridLayout(0,1));
hahaFrame.add(Box.createRigidArea(new Dimension(0,1)));
hahaFrame.setBorder(BorderFactory.createEmptyBorder(30, 10, 80, 150));
hahaFrame.add(Box.createRigidArea(new Dimension(0,1)));
JPanel bigFrame = new JPanel();
bigFrame.add(hahaFrame, BorderLayout.NORTH);
bigFrame.add(leftPane, BorderLayout.CENTER);
add(bigFrame, BorderLayout.CENTER);
//Create the GUI and show it. For thread safety,
private void cancelButtonClicked()
stationField.setText("");
firstField.setText("");
lastField.setText("");
public void actionPerformed (ActionEvent e){
if (e.getSource() == cancelButton){
cancelButtonClicked();
}

Similar Messages

  • In Logic Pro or Pro X Meta Events don't work correctly; for example inserting Stop Playback number 52 in a specific position the playhead stops wrongly several ticks before. Then the button play does not start.

    In Logic, Pro or Pro X Meta Events don't work correctly; for example inserting Stop Playback number 52 in a specific position the playhead stops wrongly several ticks before. Then the button play does not start.

    Curious if what your describing is similar to issue 4 which starts around 9:15 in video...
    https://youtu.be/q93jdOhi4Oc
    If so this started for me, or at least I noticed it for the first time in LPX 10.1.1. What version of logic are you running?
    I've recently found that this issue also affects note timing on instrument tracks that use the "External Instrument" plugin.

  • How to trigger an ActionListener in different class on click of a tree node

    Hi guyz,
    There are three panels inside my main Frame
    -->TopPanel,MiddlePanel and BottomPanel. I have a tree structure inside a panel. This panel along with couple more panels is in MiddlePanel. My main class is "mainClass.java". Inside that i have an actionListener for a specific button. I need to trigger that actionListener when i click one of the tree nodes in the panel i specified before. The problem is that my MiddlePanel is itself a different ".java" file which is being called in my "mainClass" when a specific button is clicked. There are different buttons in my "mainClass" file and for each one i am creating different MiddlePanels depending on the buttons clicked.
    So, if i click the tree node, i need to remove the MiddlePanel and recreate the MiddlePanel(One that will be created when a different button in the mainClass file is clicked). i.e., i need to trigger the actionListener for that corresponding button. Is there a way to do it?

    use this code to call different panel by selecting tree node.....ok
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.awt.*;
    import java.sql.SQLException;
    import javax.swing.event.*;
    class MainTree extends JFrame
    private static final long serialVersionUID = 1L;
         CardLayout cl = new CardLayout();
         JPanel panel = new JPanel(cl);
    public MainTree() throws Exception
    JPanel blankPanel = new JPanel();
    blankPanel.setBorder(BorderFactory.createTitledBorder("Blank Panel"));
    panel.add(blankPanel,"0");
    panel.add(blankPanel,BorderLayout.CENTER);
         panel.setPreferredSize(new Dimension(800, 100));
         setSize(1000, 700);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    // getContentPane().setLayout(new GridLayout(1,2));
    getContentPane().setLayout(new BorderLayout());
    ConfigTree test = new ConfigTree();
    DefaultMutableTreeNode mainTree = (DefaultMutableTreeNode)test.buildTree();
    JTree tree = new JTree(mainTree);
    tree.setCellRenderer(new DefaultTreeCellRenderer(){
    private static final long serialVersionUID = 1L;
         public Component getTreeCellRendererComponent(JTree tree,Object value,
    boolean sel,boolean expanded,boolean leaf,int row,boolean hasFocus){
    JLabel lbl = (JLabel)super.getTreeCellRendererComponent(tree,value,sel,expanded,leaf,row,hasFocus);
    NodeWithID node = (NodeWithID)((DefaultMutableTreeNode)value).getUserObject();
    if(node.icon != null)lbl.setIcon(node.icon);
    return lbl;
    getContentPane().add(new JScrollPane(tree));
    loadCardPanels((DefaultMutableTreeNode)((DefaultTreeModel)tree.getModel()).getRoot());
    getContentPane().add(panel,BorderLayout.EAST);
         getContentPane().add(blankPanel,BorderLayout.WEST);
    // getContentPane().add(panel);
    tree.addTreeSelectionListener(new TreeSelectionListener(){
    public void valueChanged(TreeSelectionEvent tse){
    NodeWithID node =(NodeWithID)((DefaultMutableTreeNode)((TreePath)tse.getPath())
    .getLastPathComponent()).getUserObject();
    if(node.nodePanel != null)
    String cardLayoutID = node.ID;
    cl.show(panel,cardLayoutID);
    cl.show(panel,"0");
    public void loadCardPanels(DefaultMutableTreeNode dmtn)
    for(int x = 0; x < dmtn.getChildCount(); x++)
    if(((DefaultMutableTreeNode)dmtn.getChildAt(x)).isLeaf() == false)
    loadCardPanels((DefaultMutableTreeNode)dmtn.getChildAt(x));
    NodeWithID node = (NodeWithID)((DefaultMutableTreeNode)dmtn.getChildAt(x)).getUserObject();
    if(node.nodePanel != null)
    String cardLayoutID = node.ID;
    panel.add(cardLayoutID,node.nodePanel);
    public static void main(String[] args) throws Exception{new MainTree().setVisible(true);}
    class ConfigTree
    public Object buildTree() throws Exception
    NodeWithID n0 = new NodeWithID("HelpDesk","");
    NodeWithID n1 = new NodeWithID("Administrator",n0.nodeName);
    NodeWithID n2 = new NodeWithID("Report Form",n1.nodeName,new Tree().getContentPane());
    NodeWithID n3 = new NodeWithID("Create User",n2.nodeName,new JPanel());
    NodeWithID n4 = new NodeWithID("Unlock User",n2.nodeName,new unlockui().getContentPane());
    NodeWithID n5 = new NodeWithID("List User",n2.nodeName,new JPanel());
    NodeWithID n6 = new NodeWithID("Assign Role",n2.nodeName,new AssignRole());
    NodeWithID n9 = new NodeWithID("Operator",n1.nodeName,new JPanel());
    NodeWithID n10 = new NodeWithID("Create Ticket",n9.nodeName,new JPanel());
    NodeWithID n11 = new NodeWithID("My Ticket",n9.nodeName,new JPanel());
    NodeWithID n12 = new NodeWithID("All Ticket",n9.nodeName,new JPanel());
    NodeWithID n13 = new NodeWithID("Event Viewer",n1.nodeName,new JPanel());
    DefaultMutableTreeNode top = new DefaultMutableTreeNode(n0);
    DefaultMutableTreeNode branch1 = new DefaultMutableTreeNode(n1);
    top.add(branch1);
    DefaultMutableTreeNode node1_b1 = new DefaultMutableTreeNode(n2);
    DefaultMutableTreeNode n1_node1_b1 = new DefaultMutableTreeNode(n3);
    DefaultMutableTreeNode n2_node1_b1 = new DefaultMutableTreeNode(n4);
    DefaultMutableTreeNode n3_node1_b1 = new DefaultMutableTreeNode(n5);
    DefaultMutableTreeNode n4_node1_b1 = new DefaultMutableTreeNode(n6);
    branch1.add(node1_b1);
    branch1.add(n1_node1_b1);
    branch1.add(n2_node1_b1);
    branch1.add(n3_node1_b1);
    branch1.add(n4_node1_b1);
    DefaultMutableTreeNode node4_b1 = new DefaultMutableTreeNode(n9);
    DefaultMutableTreeNode n1_node4_b1 = new DefaultMutableTreeNode(n10);
    DefaultMutableTreeNode n2_node4_b1 = new DefaultMutableTreeNode(n11);
    DefaultMutableTreeNode n3_node4_b1 = new DefaultMutableTreeNode(n12);
    node4_b1.add(n1_node4_b1);
    node4_b1.add(n2_node4_b1);
    node4_b1.add(n3_node4_b1);
    DefaultMutableTreeNode node5_b1 = new DefaultMutableTreeNode(n13);
    branch1.add(node1_b1);
    branch1.add(node4_b1);
    branch1.add(node5_b1);
    return top;
    class NodeWithID
    String nodeName;
    String ID;
    JPanel nodePanel;
    ImageIcon icon;
    public NodeWithID(String nn,String parentName)
    nodeName = nn;
    ID = parentName+" - "+nodeName;
    public NodeWithID(String nn,String parentName,Container container)
    this(nn,parentName);
    nodePanel = (JPanel) container;
    nodePanel.setBorder(BorderFactory.createTitledBorder(ID + " Panel"));
    public NodeWithID(String nn,String parentName,JPanel p, ImageIcon i)
    this(nn,parentName,p);
    icon = i;
    public String toString(){return nodeName;}
    }

  • Signing 2 different classes in the same package differently.

    I have a class B in the default package.
    I have another class C which is kept in a jar file without any package information. I have signed this jar file in using one alias in my keystore.
    class B instantiates class C and passes its own reference to it.
    When I run class B, i get an error saying,
    Exception in thread "main" java.lang.SecurityException: class "C"'s signer information does not match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(ClassLoader.java:599)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:532)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    at B.main(B.java:23)
    Does this mean, I cannot have 2 classes in the same package, signed differently?
    Thanks
    AahRiMaaN

    coupdegrace wrote:
    JoachimSauer wrote:
    Force1 wrote:
    Do the files get automatically compiled if they are in the same package ?No, but if the class you compile depends on another that's not yet been compiled (or for which the source is newer than the .class file), then it will be compiled as well.Like,say If i add a int parameter, amethod(int i),then I will get a error,isn't it ?It actually gives a error.
    Also it will compile automatically only for the first time and any changes made to any file will have to be compiled into latest .class files ?Yes.
    Did compile the files under the above constraints.
    So it is a smooth "run" for the first time,but not after editions to the either files.
    I would appreciate if experts give some feedback on this.
    Thank you.

  • Execute Authority Check With an different User then the logged on one

    Hello,
    is there any possibilty to make the command "AUTHORITY-CHECK" with another user then the user which is actually logged in into the system.
    For Example: my Username "USER1".
    Login with user "USER1".
    Run ABAP Pogramm to check if user "USER2" has the autority for an auth. object per command "AUTHORITY-CHECK".
    Thanks for all Ideas.
    Best Regards
    Marcus

    Try the FM AUTHORITY_CHECK!
    Cheers,
    Ramki.

  • Why i get different value when subtractin​g two elements of different arrays then the actual value in a timed loop

    Hi Everyone
    I have a probem in substracting the two elements of two different  1-D arrays. The problem is, I am taking out data from a CCD camera which gives me data in form of 2-D array. So i select 1-D array out of it. Now this CCD output is in a timed loop, hence i am getting data in each loop. I select a perticular array output of the CCD and this is then passed to shift register and in all the loops later on, one of the element of the output array of the CCD is substracted from the same indexed element of the selected array. For reference i have pasted the snap shot of the block diagram. In this snap shot you see three probes. The value at the prob 1 is 232, at probe 2 is 255 and at 3 is 4294967273, where as actually i sould have a value of -23 since i am substacting prob 1 and probe 2 values. Since the value of probe 2 will always remain at 255 as i have fixed it by choosing an array form CCD and i checked the value of probe 1 which never goes above 255 so why do i get this false value here.
    Can you please help me in problem.
    Regards
    Chauhan
    Attachments:
    clip_image0011.gif ‏15 KB

    Your data is U32 (unsigned integer) which does not have negative values. According to unsigned integer math, "negative" results will wrap.
    You need to work in a datatype that is appropriate for what you want to do. How many significant bits do you have in the raw data?
    Message Edited by altenbach on 03-17-2008 11:15 AM
    LabVIEW Champion . Do more with less code and in less time .

  • Displaying data on a different level then the allocation check

    Hi
    we are creating sales orders in R/3 and executing a sales order check based on a planning area in APO.
    this check is done on Product / sold to, because that is the level where teh forecast is entered.
    However, one sold to can contain different ship to's. so because of disagregation, it is randomly done over the ship to's.
    What we want to obtain is that the when the allocation check is done and the orders is in APO via the CIF, the data is displayed on product sold to, ship to like in the sales order while the check to see if there is enough quantity can remain on product sold to.
    Do you have any ideas?
    Tommy

    Tommy,
    Please elaborate on your problem.
    I assume you are talking about the Planning book used for Allocations; please confirm.  If the only CVCs in your Allocation planning book and your Product Allocation Group are 'Product' and 'Sold To', then 'ShipTo' (and ShipTo disaggregation) is irrelevant.  Product Allocation only considers the CVCs that have been created.  In this case, multiple ShipTos against a single SoldTo are 'first come first served' until the SoldTo Incoming Orders qty reaches the SoldTo Allocation Qty.
    It is possible to include ShipTo in your Allocation Group and Allocation Planning Area in addition to SoldTo; this is a fairly common solution.  If you do so, you will THEN have to consider ShipTo Disaggregation issues.  Since this seems to be a negative issue for you, I would recommend against it.
    Best Regards,
    DB49

  • Using main class's methods from a different class in the same file

    Hi guys. Migrating from C++, hit a few snags. Hope someone can furnish a quick word of advice here.
    1. The filename is test.java, so test is the main class. This code and the topic title speak for themselves:
    class SomeClass
         public void SomeMethod()
              System.out.println(test.SomeOperation());
    public class test
         public static void main(String args[])
              SomeClass someObject = new SomeClass();
              someObject.SomeMethod();
         public static String SomeOperation()
              return "SomeThing";
    }The code works fine. What I want to know is, is there some way to use test.SomeOperation() from SomeClass without the test.?
    2. No sense opening a second topic for this, so second question: Similarly, is there a good way to refer to System.out.println without the System.out.? Like the using keyword in C++.
    Thanks.

    pfiinit wrote:
    The code works fine. What I want to know is, is there some way to use test.SomeOperation() from SomeClass without the test.?Yes you can by using a static import, but I don't recommend it. SomeOperation is a static method of the test class, and it's best to call it that way so you know exactly what your code is doing here.
    2. No sense opening a second topic for this, so second question: Similarly, is there a good way to refer to System.out.println without the System.out.? Like the using keyword in C++.Again, you could use static imports, but again, I don't recommend it. Myself, I use Eclipse and set up its template so that when I type sop it automatically spits out System.out.println(). Most decent IDE's have this capability.
    Also, you may wish to look up Java naming conventions, since if you abide by them, it will make it easier for others to understand your code.
    Much luck and welcome to this forum!

  • Ctxsrv on a different server then the database?

    Hi,
    I have a table with a column containing a full file path to
    documents stored out on the server. This column has a text index
    on it with datastore=BFILE
    Now the customer wants to move the database to a dedicated db-
    server, and the problem is that from this server it would not be
    possible to see the documents referred to from the indexed
    column.
    I had an idea to keep the ctxsrv-process running on the original
    server ( where all documnts are accessible ) and log on to the
    database over Sql*Net.
    I managed to set this up but when I try to index documents I end
    up with a lot of "DRG-11513: unable to open or write to file"
    Is this setup impossible?, any ideas on how to deal with this
    problem?
    regards /Curt

    Hi,
    ctxsrv is for further releases not longer supported and you have
    to use ctx_ddl.sync and this has to run on the database site.
    So if you are not allowed to map the filesystem then
    I think the nicest method is to use URL_DATASTORE and got the
    files via a weblistener from your 'file store server'.
    Cheers
    Thomas

  • Can Labview drivers be on a different drive then the C?

    I want to put the drivers on a different drive is this possible?  Thanks

    justified wrote:
    is this possible?
    Possible, probably yes - just point the installation to another drive.
    Desirable, I would guess not, because things work best in their default location.
    However, if you want to install everything (including LabVIEW itself) to a different drive, you should probably not have any problems.
    Try to take over the world!

  • Updating JPanel with buttons from a different class

    I have a JPanel in a class that has a gridlayout with buttons in it for a game board. And my problem is that when I want to update a button using setIcon() the button doesn't change in the GUI because the buttons are in a different class. The JPanel is in a Client class and the buttons are in a GamePlugin class. I've tried a bunch of different things but none of them worked or it was way too slow. I'm sure theres an easy way to do it that I'm not seeing. Any suggestions? Heres part of my code for updating the GUI.
    private JPanel boardPanel = new JPanel(); 
    Container cP = getContentPane();
    cP.add(boardPanel, BorderLayout.WEST);
    boardPanel.setPreferredSize(new Dimension(400, 400));
    boardPanel.setLayout(new GridLayout(8, 8));
    cP.add(optionsPanel, BorderLayout.CENTER);
          * Gets the board panel from the selected plugin.
         public void drawGameBoard(GamePlugin plugin) {
              board = (OthelloPlugin)plugin;
              boardPanel = board.getBoardPanel();
              for (int i = 0; i < GamePlugin.BOARD_SIZE; i++)
                   for (int j = 0; j < GamePlugin.BOARD_SIZE; j++) {
                        board.boardButtons[i][j].setActionCommand("" + i + "" + j);
                        board.boardButtons[i][j].addActionListener(this);
          * This method takes a GameBoard and uses it to update this class' data
          * and GUI representation of the board.
         public void updateBoard(GamePlugin updatedBoard) {
              board = (OthelloPlugin)updatedBoard;
              for (int i = 0; i < GamePlugin.BOARD_SIZE; i++) {
                   for (int j = 0; j < GamePlugin.BOARD_SIZE; j++) {
                        int cell = board.getCell(i,j);
                        if (cell == OthelloPlugin.PLAYER1){
                             board.boardButtons[i][j].setIcon(black);
                        else if (cell == OthelloPlugin.PLAYER2)
                             board.boardButtons[i][j].setIcon(white);
                        else
                             board.boardButtons[i][j].setText("");
         }

    txp200:
    I agree that a call to validate() , possibly repaint(), should fix your problem. In the class with the panel that the buttons are on, i would create a static repaint method that call panel.repaint(). You can then call that method in your other class. Just make sure u only use methods to change the properties of the button, never make a make a new one, as then you will lose the association with the panel. Hope this helps.
    -- Brady E

  • Bug? Unable to add ActionListener using Anonymous class.

    Hi,
    I come accross one strange behaviour while adding ActionListener to RCF component.
    I am trying to add the ActionListener in the managed bean using the Anonymous.
    We can add the actionListener to a button using following methods. I am talking about the the first case. Only this case is not working. Rest other 2 cases are working properly.
    Case 1:
    class MyClass {
         RichCommmandButton btnTest = new RichCommmandButton();
         public MyClass(){
              btnTest.addActionListener(new ActionListener(){
                   public void processAction(ActionEvent event){
    Case 2:
    class MyClass implements ActionListener {
         RichCommmandButton btnTest = new RichCommmandButton();
         public void processAction(ActionEvent event){
    <af:button binding="#{myClassBean.btnTest}" actionListener="#{myClassBean.processAction}"/>
    Case 3:
    class MyClass implements ActionListener {
         RichCommmandButton btnTest = new RichCommmandButton();
         public void addActionLister(){
              //Use EL to add processAction(). Create MethodBinding
              FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory exprfactory = facesContext.getApplication().getExpressionFactory();
              MethodExpression actionListener =
    exprfactory.createMethodExpression(elContext, "#{myClassBean.processAction}", null, new Class[] { ActionEvent.class });
              btnTest.setActionListener(actionListener);
         public void processAction(ActionEvent event){
    Java has provided good way to use the Anonymous classes while adding the listeners. It should work with the RCF also.
    Some how i found the case 1 usefull, as i can have as many buttons in my screen and i can add the actionListener in one method. Also it is easy to read. I dont have to see the JSPX page to find the associated actionListener method.
    Is it a bug or i am wrong at some point?
    Any sujjestions are welcome.
    - Sujay.

    Hello Sujay,
    As I said in my previous reply, you can try with request scope. In JSF you shouldn't use the binding attribute very often. I agree that anonymous class is nice, but don't forget that you might be dealing with client state saving here so it cannot be perfectly compared with Swing that maintains everything in RAM. What I think happens with you currently is the following:
    1. Bean is created and the button instance as well. The ActionListener is added to the button;
    2. The view is rendered and while it is, the binding attribute is evaluated, resulting in the get method of your bean being called;
    3. Since the method returns something different than null, the button instance created in 1. get used in the component tree;
    4. The tree's state is saved on the client, since your class isn't a StateHolder, nor Serializable, the StateManager doesn't know how to deal with it so it gets discarded from the saved state and maybe from the component itself (would have to debug the render view phase to be sure);
    5. The postback request arrives, the tree is restored. When the handler reaches the button, it call the bean that returns the same instance that was used in the previous tree (since not request scoped), which is BAD because the remaining of the tree is not made of the same object instances, but rather new deserialized ones. The component then gets updated from the client state saved in 4, this might also be where the listener get removed (again debugging would tell you this, but I would tend more with the previous possibility). Note that with a request scoped bean you would have to add the listener during the first get method call (by checking if the component is null) or in the constructor as you're doing right now. It would be a very clean way and you could give the request bean (and thus the listener) access to the conversation scoped bean through injection which is very nice as well.
    6. The invoke application phase occurs and the listener is no longer there.
    Btw, this isn't a rich client issue, more a specification one. I'm curious if it works in a simple JSF RI application, if it does then I guess it would be a bug in Trinidad and/or rich client state handling architecture (using FacesBean).
    Regards,
    ~ Simon

  • Why differences in the way different machines handle the same code??

    OK, I've posted some other threads re some difficulties in getting the same code to function identically on, not only different platforms, but even on different machines running Windows!
    Here's another, and I would really appreciate an explanation:
    I have a tree control. Per the user's request, I made the right button function the same way it does on MS File Explorer: When they right click, the currently selected nodes are compared to the node they clicked over. If they clicked over a selected node, then the context menu for the nodes selected is displayed. If they clicked over a different node, then the selection is changed to the new node and the context menu displayed. If they right click over the tree control, but not a node in the tree, then the selection is cleared and no context menu is displayed.
    Works great on my machine.
    However, on some machines, no context menu is displayed, nor is the node selected... UNLESS THEY ALREADY HAVE A NODE SELECTED. I.e., if they have no nodes in the tree selected, they cannot display the context menu by right clicking on a node, nor does the selection change to the node they right click over. It only works if they already have something selected.
    My app is distributed as an executable jar file and I am distributing the JRE with it, so there are no class path issues or differences in the JDK. Basically, my problem can be paraphrased as: Why doesnt' Swing behave the same way on different machines...? At least why not the same on the eame machine.
    It's driving me nuts to think that I've resolved some UI glitch only to find out that, no, it's only fixed on some machines, not others.
    Thanks.

    Well, I normally develop on OSX and then deploy to Windows. But, this last build I have switched to Windows XP. The kinds of differences I am seeing are subtle: what triggers a repaint of the UI and now, it seems, what events are getting triggered by mouse clicks.
    My deployment is an executable jar file, therefore it uses the manifest in the jar, not any classpath variables. I deploy an entire JRE along with the app, and the bat file that launches the app ensures that is the JAVA_HOME I'm using.
    I can only guess that it's some underlying difference in versions of the platform and OS that causes this.
    Here's the entire code for this latest issue re the popups:
            private void maybeShowPopup(NodeInfoTree tree, MouseEvent e) {
                if (e.isPopupTrigger()) {
                    //  They clicked the platform dependent popup trigger...
                    int x = e.getX();
                    int y = e.getY();
                    TreePath[] selectedPaths = tree.getSelectionPaths();
                    if (selectedPaths == null) {
                        selectedPaths = new TreePath[0];
                    TreePath clickedPath = tree.getPathForLocation(x,y);
                    if (clickedPath == null) {
                        //  they right clicked, but not on a node, so clear the selection and return
                        tree.clearSelection();
                        return;
                    } else {
                        // They clicked on a path, so let's see if it is a selected
                        // node.  Search the selected array of paths, short circuiting
                        // out if it is found...
                        boolean foundInSelection = false;
                        for (int i=0; (!foundInSelection && (i < selectedPaths.length)); i++) {
                            foundInSelection = clickedPath.equals(selectedPaths);
    if (!foundInSelection) {
    // They right clicked elsewhere than the selection, so
    // reset the selection to the new path...
    tree.setSelectionPath(clickedPath);
    final TreePath menuPath;
    selectedPaths = tree.getSelectionPaths();
    if (selectedPaths == null) {
    return;
    } else {
    menuPath = selectedPaths[selectedPaths.length-1];
    // Since they did click on a node, now we need to determine
    // what popup menu should be displayed...
    tree.scrollPathToVisible(menuPath);
    NodeInfo ni = (NodeInfo) menuPath.getLastPathComponent();
    // If the last path component is null, then they don't have
    // anything selected, so we do nothing
    if (ni == null) return;
    // See if the Node is overriding our default popup menu...
    com.harcourt.applications.tgen.browser.nodes.NodeMenu nodeMenu = ni.getMenu();
    nodeMenu.activate(tree.getView(),ni);
    JPopupMenu popup = (JPopupMenu) nodeMenu;
    if (popup != null) {
    popup.show(e.getComponent(),
    e.getX(), e.getY());
    The nodeMenu.activate call is just used to check whether or not certain menu options need to be enabled or disabled before displaying the menu. My theory right now is that, on some of these machines (all windows), a right click of the mouse is not generating a mouse event unless they have already something selected. I don't think it's a focus issue, because if they left click to select a node, and then ctrl-left click to de-select it, the right button then no longer generates a popup menu. They must select a node, then right click. Maybe there's no mouse event generated, or maybe this line is failing on some machines?:
    TreePath clickedPath = tree.getPathForLocation(x,y);

  • Different SDKs for the same game

    Hello all, I developed a good amount of games using the Sony Ericsson SDK and they seem to work alright on a couple of 'real' Sony Ericsson phones I tested them on. They all work good with the Sony Ericsson emulators in the SDK.
    They don't work at all on my SLVR L6 Motorola phone. Is this because I need to build a different version of the games under the motorola SDK? Should it matter which SDK you build your games under?
    Thanks so much for your attention.

    Hi
    > They don't work at all on my SLVR L6 Motorola phone.
    Is this because I need to build a different version
    of the games under the motorola SDK? If you target specific phones, then it is ok to use specific API. If you target different types (vendor) of phones, then a more general approuch should be considered. The SE SDK might use different implementation of the specification than Motorola SDK. I saw such differences between SonyEricsson and Siemens. Also, if you use vendor specific classes, then the app will not work on phones from other vendors
    > Should it matter which SDK you build your games under?
    Yes. I would try using the general midp and cldc implementation and if you need specific functions, then go for a third party library or API, which can be integrated on any vendor specific phone.
    Mihai

  • Using two Button classes for single Button control MFC

    Hi,
    Here is my problem:
    I have a VC++ MFC dialog based application. There I am adding a Button to my dialog by just drag and drop from the tool box.
    I am also having a MyCustomButton.dll to give new looks to the button.
    Inside MyCustomButton.dll, MyCustomButton.cpp is the button class which is derived from CButton. 
    Now I want the behavior of my application in such a way at execution of my application, like if the  MyCustomButton.dll is present in system then the button of my dialog should look like as per implementation of MyCustomButton.dll, where as if the dll
    is not present normal MFC button should get displayed.
    Please guide me in achieving this. How can I make my application (*.exe) decide at run time.
    Thanks in Advance,
    Thanks & Regards, Mayank Agarwal

    Thanks Rupesh,
    But my requirement is like that only I have to decide at run time.
    Please look the scenario below:
    //  MyDialogDlg.h //
    #include "MyCustomButton.h"
    class MyDialogDlg
    MyCustomButton m_CalcButton;
    In the above piece of code
    m_CalcButton is object of  MyCustomButton class.
    and my requirement is such that if MyCustomButton
    .dll is not present then,  m_CalcButton should executed as the object of CButton class of MFC.
    There are cases where I  cant ship the dll.
    In such case how should I write the code? Please guide.
    Thanks in Advance.  
    Thanks & Regards, Mayank Agarwal

Maybe you are looking for