When generate automatically a JTable after a click on a tree node

final int x[] = {0, 1, 2, 22, 0, 2, 0, 1, 0, 2};
final int y[] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3};
final int larg[] = {1, 1, 20, 1, 2, 21, 1, 22, 2, 22};
final int haut[] = {1, 1, 1, 1, 1, 1, 1, 1, 22, 22};
final int px[] = {5, 5, 85, 5, 0, 0, 0, 0, 0, 0};
final int py[] = {2, 0, 0, 0, 2, 0, 2, 0, 94, 0};
//****************** POSITIONNEMENT DES COMPOSANTS
final Container conteneur = getContentPane();
final GridBagLayout gridBg = new GridBagLayout();
conteneur.setLayout(gridBg);
final GridBagConstraints contrainte = new GridBagConstraints();
contrainte.fill = contrainte.BOTH;
//*********** JCOMBO1 **************
borneDate1 = new JComboBox();
Calendrier req = new Calendrier();
String[] valCal = req.lireDansTable();
borneDate1.addItem("");
for (int i = 0; i<= valCal.length - 1; i++){
      borneDate1.addItem(valCal);
contrainte.gridx = x[0];
contrainte.gridy = y[0];
contrainte.gridwidth = larg[0];
contrainte.gridheight = haut[0];
contrainte.weightx = px[0];
contrainte.weighty = py[0];
contrainte.insets = new Insets(1, 1, 1, 1);
contrainte.ipadx = 20;
gridBg.setConstraints(borneDate1, contrainte);
conteneur.add(borneDate1);
//*********** JCOMBO2 **************
borneDate2 = new JComboBox();
req = new Calendrier();
valCal = req.lireDansTable();
borneDate2.addItem("");
for (int i = 0; i<= valCal.length - 1; i++){
borneDate2.addItem(valCal[i]);
contrainte.gridx = x[1];
contrainte.gridy = y[1];
contrainte.gridwidth = larg[1];
contrainte.gridheight = haut[1];
contrainte.weightx = px[1];
contrainte.weighty = py[1];
gridBg.setConstraints(borneDate2, contrainte);
conteneur.add(borneDate2);
//*********** JLABEL1 **************
lbl1 = new JLabel(" Dates de S�lection.");
contrainte.gridx = x[2];
contrainte.gridy = y[2];
contrainte.gridwidth = larg[2];
contrainte.gridheight = haut[2];
contrainte.weightx = px[2];
contrainte.weighty = py[2];
gridBg.setConstraints(lbl1, contrainte);
conteneur.add(lbl1);
//*********** BOUTON IMPRIMER **************
btmImprimer = new JButton("IMPRIMER");
contrainte.gridx = x[3];
contrainte.gridy = y[3];
contrainte.gridwidth = larg[3];
contrainte.gridheight = haut[3];
contrainte.weightx = px[3];
contrainte.weighty = py[3];
gridBg.setConstraints(btmImprimer, contrainte);
conteneur.add(btmImprimer);
//*********** BOUTON AUJOURD'HUI **************
btmAujourdhui = new JButton("Ce jour");
contrainte.gridx = x[4];
contrainte.gridy = y[4];
contrainte.gridwidth = larg[4];
contrainte.gridheight = haut[4];
contrainte.weightx = px[4];
contrainte.weighty = py[4];
gridBg.setConstraints(btmAujourdhui, contrainte);
conteneur.add(btmAujourdhui);
//*********** JLABEL 2 **************
lbl2 = new JLabel(" Journal.");
//lbl2.setVisible(false);
contrainte.gridx = x[5];
contrainte.gridy = y[5];
contrainte.gridwidth = larg[5];
contrainte.gridheight = haut[5];
contrainte.weightx = px[5];
contrainte.weighty = py[5];
gridBg.setConstraints(lbl2, contrainte);
conteneur.add(lbl2);
//*********** JLABEL 3 **************
lbl3 = new JLabel(" Adresse ");
contrainte.gridx = x[6];
contrainte.gridy = y[6];
contrainte.gridwidth = larg[6];
contrainte.gridheight = haut[6];
contrainte.weightx = px[6];
contrainte.weighty = py[6];
gridBg.setConstraints(lbl3, contrainte);
conteneur.add(lbl3);
//*********** JTEXTFIELD **************
txtPath = new JTextField();
contrainte.gridx = x[7];
contrainte.gridy = y[7];
contrainte.gridwidth = larg[7];
contrainte.gridheight = haut[7];
contrainte.weightx = px[7];
contrainte.weighty = py[7];
gridBg.setConstraints(txtPath, contrainte);
conteneur.add(txtPath);
//*********** JTREE **************
DefaultMutableTreeNode racine = new DefaultMutableTreeNode("MEDIACAST");
//**********RECUPERER LES LIGNES ANIMATEUR*******
parentNode = new DefaultMutableTreeNode("ANIMATEURS");
racine.add(parentNode);
GenererEnregistrement enregAnimateur = new GenererEnregistrement();
String[] sEnregAnim = enregAnimateur.lireDansTable("SELECT numero_anim FROM animateur ORDER BY numero_anim", "numero_anim");
for(int i = 0; i <= sEnregAnim.length - 1; i++){
fils = new DefaultMutableTreeNode(sEnregAnim[i]);
parentNode.add(fils);
//************RECUPERER LES LIGNES COMPTE******************
parentNode = new DefaultMutableTreeNode("COMPTES");
racine.add(parentNode);
GenererEnregistrement enregCompte = new GenererEnregistrement();
String[] sEnregCompte = enregCompte.lireDansTable("SELECT id_compte FROM compte ORDER BY id_compte", "id_compte");
for(int i = 0; i <= sEnregCompte.length - 1; i++){
fils = new DefaultMutableTreeNode(sEnregCompte[i]);
parentNode.add(fils);
//************RECUPERER LES LIGNES DATE******************
parentNode = new DefaultMutableTreeNode("DATES");
racine.add(parentNode);
GenererEnregistrement enregDate = new GenererEnregistrement();
String[] sEnregDate = enregDate.lireDansTable("SELECT daty FROM calendrier ORDER BY numero_enreg", "daty");
for(int i = 0; i <= sEnregDate.length - 1; i++){
fils = new DefaultMutableTreeNode(sEnregDate[i]);
parentNode.add(fils);
//*************AFFICHAGE******************
TreeNode root = racine;
arbre = new JTree(root);
JScrollPane paneTree = new JScrollPane();
//**********EVENEMENT CLICK DROIT DANS JTREE***************
MouseListener ml = new MouseAdapter() {
public void mousePressed(MouseEvent e) {
int selRow = arbre.getRowForLocation(e.getX(), e.getY());
TreePath selPath = arbre.getPathForRow(selRow);
if(selRow != -1) {
     if(e.getButton() == 1) {
     txtPath.setText(selPath.toString());
     //**-> CREER LE VECTEUR POUR JTable**<-
     String sPere = txtPath.getText();
     int iResComp = sPere.compareTo("[MEDIACAST, ANIMATEURS]" + arbre.getLastSelectedPathComponent().toString() + "]");
     //****ANIMATEURS***************
     switch(iResComp){
     case -49:
          String sReq = "SELECT animateur.matricule, animateur.prenom, calendrier.daty, compte.id_compte";
          sReq = sReq + " " + "FROM animateur, liaison";
          sReq = sReq + " " + "WHERE animateur.numero_anim = ? AND liaison.numero_anim = ? AND calendrier.daty = liaison.daty";
          String[] sParamIn = {
          arbre.getLastSelectedPathComponent().toString(), arbre.getLastSelectedPathComponent().toString()
          String[] sTypeParamIn = {
          "entier", "entier"
          String[] sParamOut = {
          "matricule", "prenom", "daty", "id_compte"
          GenererEnregistrement enreg = new GenererEnregistrement();
          objEnreg = enreg.retournerToutEnreg(sReq, sParamIn, sTypeParamIn, sParamOut);
          iNbEnreg = enreg.donnerNbEnreg(sReq, sParamIn, sTypeParamIn, sParamOut);
          Object[] teteTable = {
          "Matricule","Prenom","Date", "Numero Compte"
                                        data = clickTreeNode(teteTable.length, iNbEnreg, sParamOut.length, objEnreg);
          tableau = new JTable(data);
                                        //*********** JTABLE **************
          JScrollPane paneTab = new JScrollPane(tableau);
          contrainte.gridx = x[9];
          contrainte.gridy = y[9];
          contrainte.gridwidth = larg[9];
          contrainte.gridheight = haut[9];
          contrainte.weightx = px[9];
          contrainte.weighty = py[9];
          gridBg.setConstraints(paneTab, contrainte);
          conteneur.add(paneTab);
          break;
          else if(e.getButton() == 3) {
               arbre.setSelectionPath(selPath);//Donne le focus au noeud click�
               txtPath.setText(selPath.toString());
          //***********POUR LES NOEUDS PERES*******************************
          if(arbre.getLastSelectedPathComponent().toString() == "ANIMATEURS"){
               System.out.println(selPath.getParentPath().toString());
          //***********POUR LES NOEUDS FILS********************************
          String sPere = txtPath.getText();
          int iResComp = sPere.compareTo("[MEDIACAST, ANIMATEURS]" + arbre.getLastSelectedPathComponent().toString() + "]");
          switch(iResComp){
               case -49:
                    System.out.println("NOEUDS DANS ANIMATEURS:" + iResComp + " " + arbre.getLastSelectedPathComponent().toString());
                    break;
               case 2:
                    if(arbre.getLastSelectedPathComponent().toString() != "COMPTES")
                         System.out.println("NOEUDS DANS COMPTES:" iResComp " " + arbre.getLastSelectedPathComponent().toString());
                         break;
               case 3:
                    if(arbre.getLastSelectedPathComponent().toString() != "DATES")
                         System.out.println("NOEUDS DANS DATES:" + iResComp + " " + arbre.getLastSelectedPathComponent().toString());
                         break;
          arbre.addMouseListener(ml);
          paneTree.setViewportView(arbre);
          contrainte.gridx = x[8];
          contrainte.gridy = y[8];
          contrainte.gridwidth = larg[8];
          contrainte.gridheight = haut[8];
          contrainte.weightx = px[8];
          contrainte.weighty = py[8];
          gridBg.setConstraints(paneTree, contrainte);
          conteneur.add(paneTree);
          //Afficher la fen�tre
          ImageIcon ico = new ImageIcon("c:\\works\\mediacast\\gpao\\hlpglobe.gif");
          this.setIconImage(ico.getImage());
          //this.pack();
          this.setVisible(true);
I want to generate automatically a table after a click on a tree node but I don't know when to procede

Please do the following.<br><br>
#In the location bar, type '''about:config''' and hit Enter.<br><br>
#In the filter at the top, type: '''keyword.URL'''<br><br>
#Double click it and remove whatever's in there and replace it with http://www.google.com/search?q= and then click OK.<br><br>
#Close the tab
The URL to add in "keyword.URL" becomes a link in this post, so right click it and choose "Copy Link Location" to copy it to the Windows clipboard. Then hit CTRL+V to paste it. Saves you having to type the whole thing.
'''To reset your home page, do the following'''.<br><br>
* Go to the site you want to set as your homepage.<br><br>
* Click the Firefox button, go to '''Options '''| '''Options '''| '''General'''.<br><br>
* Make sure it says "''Show My Homepage''" in the first dropdown menu.<br><br>
* Click the button called "'''Use Current Pages'''" to set the homepage to the one you have on the screen.<br>
N.B. Some of your plugins are out of date which exposes your system to attack. Please visit the [http://www.mozilla.com/en-US/plugincheck/ Plugins Check] page and update where necessary.
Also, click '''Help '''| '''Check For Updates''' to update Firefox to 3.6.19

Similar Messages

  • TS3048 My bluetooth mouse usually loss with unknown reasons and it then automatic connected again after some clicks.

    Dear Sir or Madam,
    I have bough my Macbook Pro since 8 months ago and it seams quite good upto now, however in these days my Bluetooth mouse ussually lossed with unknow reasons and it then automatic connected again after some clicks.
    I have check mouse battery as well as relevent reasons like turn-on, but it still repeated and I don't know what is exact problem, it due to my mouse or my mac?
    Thank you very much and looking forward to your help.
    BR

    Check your Bluetooth, do you have a bunch of stuff listed in there that you are no longer using?
    Or another peripheral you stored away in a cabinet near by?

  • How to trigger event when double click on a tree node

    I have this code which creates new tab in a remote Java Class.
    treeView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<TreeItem<String>>()
       @Override
       public void changed(ObservableValue<? extends TreeItem<String>> observable, TreeItem<String> oldValue, TreeItem<String> newValue)
       System.out.println("Selected Text : " + newValue.getValue());
       // Create New Tab
       Tab tabdata = new Tab();
       Label tabALabel = new Label("Test");
      tabdata.setGraphic(tabALabel);
       DataStage.addNewTab(tabdata);
    Can you tell me how I can modify the code to open new tab when I double click on a tree node. In my code the tab is opened when I click once. What event handler do I need?

    import java.util.Arrays;
    import javafx.application.Application;
    import javafx.event.EventHandler;
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.StackPane;
    import javafx.scene.control.TreeCell;
    import javafx.scene.control.TreeView;
    import javafx.scene.control.TreeItem;
    import javafx.scene.control.SelectionMode;
    import javafx.util.Callback;
    public class TreeTest extends Application {
      public static void main(String[] args) {
        launch(args);
      @Override
      public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("TreeView Test");
        primaryStage.setScene(createScene());
        primaryStage.show();
      private Scene createScene() {
        final StackPane stackPane = new StackPane();
        final TreeView<String> treeView = new TreeView<String>();
        treeView.setRoot(createModel());
        treeView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
        treeView.setCellFactory(new Callback<TreeView<String>, TreeCell<String>>() {
          @Override
          public TreeCell<String> call(TreeView<String> treeView) {
            return new ClickableTreeCell();
        stackPane.getChildren().add(treeView);
        return new Scene(stackPane);
      private TreeItem<String> createModel() {
        TreeItem<String> root = new TreeItem<String>("RootNode");
        TreeItem<String> packageA = new TreeItem<String>("package A");
        packageA.getChildren().addAll(
            Arrays.asList(new TreeItem<String>("A1"), new TreeItem<String>("A2"), new TreeItem<String>("A3"))
        TreeItem<String> packageB = new TreeItem<String>("package B");
        packageB.getChildren().addAll(
            Arrays.asList(new TreeItem<String>("B1"), new TreeItem<String>("B2"), new TreeItem<String>("B3"))
        root.getChildren().addAll(Arrays.asList(packageA, packageB));
        return root;
      private class ClickableTreeCell extends TreeCell<String> {
        ClickableTreeCell() {
          setOnMouseClicked(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent event) {
              // Handle double-clicks on non-empty cells:
              if (event.getClickCount()==2 && ! isEmpty()) {
                System.out.println("Mouse double-clicked on: " + getItem());
        @Override
        protected void updateItem(String item, boolean empty) {
          super.updateItem(item, empty);
          if (empty) {
            setText(null);
          } else {
            setText(item);

  • Freight cost in a purchase order when generating automatic freight cost

    Hi Experts,
    when i generate automaticly a Purchase Order whith a freight cost, in the PO it keeps the first freight in the Item Overview.
    When it generate more freight cost in the same PO, the first Freight Cost stay in the Item Overview, and the freight cost is increasing in the Item : PO History. right.
    Is it possible to remove the first entry from the Item Overview or put the total of the freight cost who are incresing in the PO??
    Thanks in advance.
    Dom.

    Hi dev,
    We did something similar last week. To charge the freight cost to the receiving party we did a manual service entry sheet for that. 
    We created a separate Po with Transport vendor and the receiving plant and account type is Z shipment costing and service item description as intercompany freight.
    You will specify the limit of the amount here, and   specify the G/L account here. Now create the service entry sheet withthe freight amount and settle.
    I think you can follow the similar thing with additional lines for your requirement for other charges.
    Since we want let the receiving plant pay the freight we didn't create the shipment cost document of LE-TRA.
    Let see if any other suggestions comes.
    Regards,
    ratna

  • Context Menu on the right click of af:tree node

    Hi Experts,
    I am using drag and drop functionality in af:tree.In that i used one tree for drag source and another one tree for drop target,and it is working as expected.
    Now I want to bring one additional option in the context menu of the target tree node that is ,when i right click on any of the target tree node in addition to the default menu options like "Collapse","Expand" i want to add one more option .For this i added "contextMenu" facet after the "nodeStamp" facet inside the tree.
    *<f:facet name="contextMenu">*
    *<af:popup id="p1">*
    *<af:menu text="Delete" id="m1">*
    *<af:commandMenuItem text="Delete" id="cmi1"*
    *action="#{myWorkflow.deleteWorkflowNode}"/>*
    *</af:menu>*
    *</af:popup>*
    *</f:facet*>
    Now the problem is : before using drag and drop the context menu workes without any problem .But after using drag and drop the context menu is not popped up.
    can anybody help me to resolve this?
    Thanks,
    Priya.

    Hi Frank,
    1. I am using JDeveloper 11.1.1.3 version
    2. Drop target tree is having the context menu.
    3. Yes . In Drop event am calling a backing bean method with return type DnDAction and i return the value as DnDAction.MOVE to reflect the changes in the database table to the target tree.
    Regards,
    Priya.

  • 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;}
    }

  • How to display a search(query) on a report clicking on a tree node to open

    I need to know how can I do with that when I press on the link(on a tree node(leaf)), open on the other region in the same page a classic or interactive report with my results(passed by parameter, example: ID).
    One example are present on web site posted below:
    http://apex.oracle.com/pls/apex/f?p=36648:34:1599336964673301::NO:::
    I have tried this to composite my tree:
    select case when connect_by_isleaf = 1 then 0 when level = 1 then 1 else -1 end as status, level, "NAME" as title, null as icon, "ID" as value, null as tooltip, decode(level, 1, 'f?p=&APP_ID.:106:'||:APP_SESSION||'::::P106_MAQ_ID:'||ID, 2,'f?p=&APP_ID.:106:'||:APP_SESSION||'::::::::P106_MAQ_ID:'||(ID-1000), 3,'f?p=&APP_ID.:104:'||:APP_SESSION||'::::P106_MAQ_ID:'||(ID-10000), 4,'f?p=&APP_ID.:105:'||:APP_SESSION||'::::P106_MAQ_ID:'||(ID-100000)) as link from "#OWNER#"."V_TREE1" start with "PID" is null connect by prior "ID" = "PID" order siblings by "NAME"
    But the parameter passed dont do with the report change your view to the one row with ID passed. I need to obtain the same results showed on website posted above.
    I obtained success on action to redirect to other page with Form with Report to edit, but dont to show. And i want to show and the same page.
    below the code that i obtained to redirect:
    select case when connect_by_isleaf = 1 then 0 when level = 1 then 1 else -1 end as status, level, "NAME" as title, null as icon, "ID" as value, null as tooltip, decode(level, 1, 'f?p=&APP_ID.:102:'||:APP_SESSION||'::::P102_MAQ_ID:'||ID, 2,'f?p=&APP_ID.:103:'||:APP_SESSION||'::::P103_SRV_ID:'||(ID-1000), 3,'f?p=&APP_ID.:104:'||:APP_SESSION||'::::P104_INS_ID:'||(ID-10000), 4,'f?p=&APP_ID.:105:'||:APP_SESSION||'::::P105_SIS_ID:'||(ID-100000)) as link from "#OWNER#"."V_TREE1" start with "PID" is null connect by prior "ID" = "PID" order siblings by "NAME"
    Thank you so much for your help.

    Muhammad,
    you can add a user parameter (p_count), which get the default value value 1 for example. Then add a field (with some source of type character like desname) for your footer with a format trigger like
    if :p_count=1 then
         srw.set_field_char(0,'Office Copy');
    elsif :p_count=2 then
         srw.set_field_char(0,'Shop Copy');
    else
         srw.set_field_char(0,'Account Dept Copy');
    end;
    return true;
    Or you build 3 boilerplates with format triggers like
    if :p_count=1 then return true; else return false; end if; for "Office Copy" .....
    In the After Report Trigger start the Report with same paramters using a higher value for p_count as parameter. If p_count=3, do nothing in the trigger.
    Regards
    Rainer

  • How to find the coordinates of a mouse click in a Tree node ?

    Hello
    I have a JTree that have few nodes. The nodes contain an icon and a label (using custom cell renderer) and I want to receive right clicks on the icon and show a popup menu.
    The problem is I can only get the right click on the whole tree node, not only the icon.
    I tried two approaches:
    1. register the mouse listener directly with the icon in the cell renderer. That doesnt work since the events received by the tree node do not propagate to its sub-components.
    2. Register the event with the JTree itself and then try to find which part of the tree node was clicked (see if it was within the coordinates of the icon).
    But I cant get the node's coordinates or width.
    I tried using SwingUtilities.convertPoint or SwingUtilities.ConvertMouseEvent but it just doesnt work with DefaultMutableTreeNode.
    Any ideas how to do it ?

    user11973359 wrote:
    1. register the mouse listener directly with the icon in the cell renderer. That doesnt work since the events received by the tree node do not propagate to its sub-components.No, it doesn't work because a renderer isn't added to any component hierarchy. It isn't in any way a 'sub-component'.
    Read about editor and renderer concepts in the Oracle tutorial on How to Use Tables.
    user11973359 wrote:
    2. Register the event with the JTree itself and then try to find which part of the tree node was clicked (see if it was within the coordinates of the icon).
    But I cant get the node's coordinates or width.<tt>getPathForLocation(...) </tt>in conjunction with<tt> getPathBounds(...)</tt>.
    db

  • Displaying data in tableview on click of a tree node

    Hi,
    I am new to BSP. I created a tree structure having the tablenames as tree nodes, and now if I click on a node I want to display corresponding table data in a tableview. How can I acheive this....??
    Thanks in advance,
    Ravindra.

    Hi Ravindra,
    You can achieve this by reading the node clicked OnInput Processing and You can assign name of your table in "onNodeClick" attribute .
    then onInputprocessing you can read the name of your table from
    "event->server_event" .
    Check this sample code .
    ****************OnLayout*******************************
    <htmlb:content design="design2003">
      <htmlb:page title = " ">
        <htmlb:form>
            <htmlb:tree     id          = "myTree1"
                             title       = "Tree"
                             tooltip     = "Tooltip for myTree1">
                <htmlb:treeNode id="NODE1" text="TABLE1" isOpen="true" onNodeClick="TABLE1">
                  </htmlb:treeNode>
                  <htmlb:treeNode id="NODE2" text="TABLE2" isOpen="true" onNodeClick="TABLE2">
                 </htmlb:treeNode>
                    <htmlb:treeNode id="NODE3" text="TABLE3" onNodeClick="TABLE3"/>
                    <htmlb:treeNode id="NODE4" text="TABLE4"onNodeClick="TABLE4" />              
                  <htmlb:treeNode id="NODE5" text="TABLE5" isOpen="false" onNodeClick="TABLE5">
                  </htmlb:treeNode>
                    <htmlb:treeNode id="NODE6" text="TABLE6" onNodeClick="TABLE6"/>
            </htmlb:tree>
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    *****************OnInputProcessing****************
    CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
    Data: TABLE_NAME type STRING.
    Optional: test that this is an event from HTMLB library.
    IF event_id = CL_HTMLB_MANAGER=>EVENT_ID.
    Scenario 1: Read event from manager.
      DATA: event TYPE REF TO CL_HTMLB_EVENT.
      event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
      IF event IS NOT INITIAL AND event->name = 'tree'.
        DATA: tree_event TYPE REF TO CL_HTMLB_EVENT_TREE.
        tree_event ?= event.
       TABLE_NAME = event->server_event.
      ENDIF.
    ENDIF.
    Check examples given in "SBSPEXT_HTMLB" bsp application.
    I hope this will help.
    Regards,
    Monica

  • Help for Activating Editing Mode on F2 Keyboard Click for a Tree Node

    I have a Jtree with several Nodes on the Left Pane. On the Right Pane I have a nodes corresponding Screen with many properties. There is a way to change the Node Name by editing the Name Field property on the Right.
    I want to Edit the tree Node name by Clicking F2 on the selected Node, Get it in the Editable Mode, Change the name and press enter. How Do I activate this editable Mode on Click of Keyboard F2 Button.

    tree.setEditable( true );

  • 15-r007TU-Display does not turn on when it automatically turns off after closing lid.

    I just purchased hp 15-r007TU, Windows 8.1 x84. I'm facing a strange problem. After all initial setup, I put the laptop on to download and install all lates Windows 8.1 patches. The display is set to tuen off automaticaaly after 5 minutes. After 5 min it did turn off as set. But then I can not turn it back on. I pressed all (except power) keys, used touch pad, closed lid and opened but it stayed off. Laptop was on and running as I could see HDD lights flickering, I could hear system sounds on pressign mute/volume keys, also I could toggle WiFi with key. I then pressed power off key to turn Windows off normally. I did turn off. I again turned it on, I could see 'hp' logo with spinning wheel and then nothing. Display is off and I don't see start screen. I have to hard reset (press power button for more than 5 seconds) then display is normal. This happens every time the display turns itself off automatically after set time or I close the lid. Only after hard reset it works normally and I see the start menu.
    The power settings I use are:
    1. never put system to standby after preset time. (either on battery or AC power)
    2. turn display off after 5 min. (both on battery or AC power)
    3. when I close lid - do nothing. (both on battery or AC power)
    4. when I press power button - shut down
    I am using Windows 8.1 x64 with all latest patches installed. BIOS updated to lates available. All latest drivers installed.
    I have not yet set password to the system to log in.
    Help would be immensly appreciate. The device is still in warrenty if it needs to be replaced.

    Hello K1200LT,
    Welcome to the HP Forums!
    I understand the computer will not sleep when you shut down the lid. You seem to have already done most of the troubleshooting I would've suggested.
    To be honest,  it is either a hardware or software-related issue. To determine this, I would like you to reinstall the operating system. It will clear up any software conflicts and allow you to start fresh.
    First, please ensure you backup your files. Here is information on how to do this: Backing Up Your Files (Windows 8)
    Once this is done, it is safe to reinstall the operating system. Performing an HP System Recovery (Windows 8)
    If the same situation occurs, the computer likely has faulty hardware. At that point, please contact HP phone support. You can utilize this website to learn how to contact HP appropriately, based on your region: Contact HP Worldwide
    Please let me know what happens. Thanks!
    Mario
    I worked on behalf of HP.

  • Single Click on simple tree node

    Hi Experts,
    I have a problem ,please help me.
    I need event is trigger on single click on node of simple tree.There is event of double click but i need on single click only.
    If you have any test program please forward it also.
    Ankur Garg.

    i dont think for single click you can get any event in simple list... you can make hotspot on by this way single click will trigger the at line-selection event.
    REPORT  ZSPDEXDET LINE-SIZE 200 line-count 19(4).
    TABLES : MAST,STPO,MARA,MARC.
    INCLUDE <SYMBOL>.
    DATA : BEGIN OF I_BOM OCCURS 0.
            INCLUDE STRUCTURE STPOX.
    DATA : END OF I_BOM.
    DATA : BEGIN OF ITAB OCCURS 0,
           STUFE LIKE STPOX-STUFE,
           IDNRK LIKE STPOX-IDNRK,
           WEGXX LIKE STPOX-WEGXX, "NODE NO
           TTIDX LIKE STPOX-TTIDX, "NODE NO WITH PARENTNODE + 1
           VWEGX LIKE STPOX-VWEGX, "NODE NO OF PARENT
           MENGE LIKE STPOX-MENGE,
           SYMBOL,
           END OF ITAB.
    DATA : ITAB1 LIKE ITAB OCCURS 0 WITH HEADER LINE,
           ITAB2 LIKE ITAB OCCURS 0 WITH HEADER LINE.
    DATA : V_PARENTID LIKE STPOX-VWEGX,
           V_WEGXX LIKE STPOX-WEGXX,
           V_STUFE LIKE STPOX-STUFE,
           PREV_STUFE LIKE STPOX-STUFE.
    DATA : V_OFFSET TYPE I VALUE 1,
           V_CONTENT TYPE I,
           TABIX LIKE SY-TABIX,
           V_TABIX LIKE SY-TABIX,
           T_TABIX LIKE SY-TABIX,
           V_SYMBOL,
           V_LINE LIKE SY-TABIX,
           T_INDEX TYPE I.
    DATA :  V_PAGE LIKE SY-PAGNO,
            T_PAGE LIKE SY-PAGNO,
            V_LIN LIKE SY-LILLI.
    PARAMETERS : P_MATNR LIKE MAST-MATNR,
                 P_WERKS LIKE MARC-WERKS.
    PERFORM BOM_EXPLODE.
    ITAB1[] = ITAB[].
    READ TABLE ITAB1 INDEX 1.
    APPEND ITAB1 TO ITAB2.
    PERFORM PRINT TABLES ITAB2.
    AT LINE-SELECTION.
      V_LIN = SY-LILLI.
      T_PAGE = V_PAGE.
      PREV_STUFE = ITAB2-STUFE.
      V_STUFE = ITAB2-STUFE + 1.
      V_WEGXX = ITAB2-WEGXX.
      V_SYMBOL = ITAB2-SYMBOL.
      IF ITAB2-SYMBOL = '+'.
        ITAB2-SYMBOL = '-'.
        MODIFY ITAB2 INDEX V_TABIX.
      ELSEIF ITAB2-SYMBOL = '-'.
        ITAB2-SYMBOL = '+'.
        MODIFY ITAB2 INDEX V_TABIX.
      ENDIF.
      LOOP AT ITAB WHERE STUFE = V_STUFE AND VWEGX = V_WEGXX.
        V_TABIX = V_TABIX + 1.
        IF V_SYMBOL = '+'.
          MOVE-CORRESPONDING ITAB TO ITAB2.
          ITAB2-SYMBOL = '+'.
          INSERT ITAB2 INDEX V_TABIX.
        ELSEIF V_SYMBOL = '-'.
         IF V_TABIX GT 2.
          LOOP AT ITAB2 FROM V_TABIX WHERE STUFE = PREV_STUFE.
            T_TABIX = SY-TABIX.
            T_TABIX = T_TABIX - 1.
            EXIT.
          ENDLOOP.
           IF V_TABIX LE T_TABIX.
            DELETE ITAB2 FROM V_TABIX TO T_TABIX.
           ELSE.
            LOOP AT ITAB2 FROM V_TABIX.
    *          T_TABIX = T_TABIX + 1.
              IF ITAB2-STUFE GT PREV_STUFE.
               DELETE ITAB2 INDEX SY-TABIX.
              ELSE.
                EXIT.
              ENDIF.
            ENDLOOP.
    *        DELETE ITAB2 FROM V_TABIX WHERE STUFE LT V_STUFE.
           ENDIF.
           EXIT.
          ELSE.
            DELETE ITAB2 FROM V_TABIX.
            EXIT.
          ENDIF.
        ENDIF.
      ENDLOOP.
      SY-LSIND = 0.
      T_INDEX = 1.
      PERFORM PRINT TABLES ITAB2.
      SCROLL LIST INDEX T_INDEX TO PAGE T_PAGE . " LINE V_LIN .
    *&      Form  BOM_EXPLODE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM BOM_EXPLODE .
      CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
        EXPORTING
          CAPID                 = 'PP01'
          DATUV                 = SY-DATUM
          MEHRS                 = 'X'
          MTNRV                 = P_MATNR
          WERKS                 = P_WERKS
        TABLES
          STB                   = I_BOM
        EXCEPTIONS
          ALT_NOT_FOUND         = 1
          CALL_INVALID          = 2
          MATERIAL_NOT_FOUND    = 3
          MISSING_AUTHORIZATION = 4
          NO_BOM_FOUND          = 5
          NO_PLANT_DATA         = 6
          NO_SUITABLE_BOM_FOUND = 7
          CONVERSION_ERROR      = 8
          OTHERS                = 9.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ITAB-IDNRK = P_MATNR.
      ITAB-MENGE = '1'.
      ITAB-STUFE = '0'.
      ITAB-WEGXX = '0'.
      ITAB-TTIDX = '0'.
      ITAB-VWEGX = '-1'.
      ITAB-SYMBOL = '+'.
      APPEND ITAB.
      CLEAR ITAB.
      LOOP AT I_BOM.
        MOVE-CORRESPONDING I_BOM TO ITAB.
        APPEND ITAB.
        CLEAR ITAB.
      ENDLOOP.
    ENDFORM.                    " BOM_EXPLODE
    *&      Form  PRINT
    *       text
    *      -->P_ITAB1  text
    FORM PRINT  TABLES   P_ITAB1 STRUCTURE ITAB.
      DATA : V_ID LIKE STPOX-VWEGX.
      DATA : T_LINE LIKE SY-TABIX,
             V_LINE TYPE I,
             V_HLINE TYPE I.
      DATA : PAGE TYPE I.
      DESCRIBE TABLE P_ITAB1 LINES V_LINE.
      T_LINE = V_LINE - 1.
      LOOP AT P_ITAB1.
        V_OFFSET = P_ITAB1-STUFE * 3.
        V_CONTENT = P_ITAB1-STUFE * 6.
        V_LINE = P_ITAB1-STUFE * 4.
        IF P_ITAB1-STUFE NE 0.
          V_HLINE = V_LINE + 2.
        ELSE.
          V_HLINE = 2.
        ENDIF.
    *    T_INDEX = T_INDEX + 1.
        COMPUTE PAGE = SY-TABIX MOD 13.
        IF PAGE EQ 0.
          NEW-PAGE.
          V_PAGE = SY-PAGNO.
    *     T_INDEX = 0.
        ENDIF.
        V_TABIX = SY-TABIX.
        IF P_ITAB1-SYMBOL = '+'.
           WRITE : /.
            WRITE AT : V_OFFSET  SYM_PLUS_FOLDER AS SYMBOL
                    COLOR 4 INTENSIFIED HOTSPOT.
            WRITE : AT V_CONTENT P_ITAB1-IDNRK,P_ITAB1-MENGE.
          HIDE : P_ITAB1,V_TABIX,V_PAGE.
        ELSEIF P_ITAB1-SYMBOL = '-'.
          WRITE : /.
          WRITE AT V_OFFSET SYM_MINUS_FOLDER AS SYMBOL
                    COLOR 4 INTENSIFIED HOTSPOT.
          WRITE : AT V_CONTENT P_ITAB1-IDNRK,P_ITAB1-MENGE.
          HIDE : P_ITAB1,V_TABIX,V_PAGE.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " PRINT
    regards
    shiba dutta

  • Double-click on tree nodes

    Is there a way to disable the double-click-to-expand-
    node feature? This seems to be a default behaviour,
    wish to remove it. Thanks in advance.

    I use forms6i patch 12. And that is what I have:
    Block 'TREE'
    Triggers
    WHEN-MOUSE-DOUBLECLICK
    begin
    :global.MDC := 1;
    Message ('1', Acknowledge);
    Pause;
    end;
    Tree_Item
    WHEN-TREE-NODE-EXPANDED
    begin
    Message ('2', Acknowledge);
    Pause;
    if :global.MDC = 1 then
    :global.MDC := 0;
    Return;
    else
    FillLevel; --(e.g. fill the lower nodes and
    -- expand the parent node)
    end if;
    end;
    And that is what I get at runtime after double clicking on a collapsed node:
    1 (acknowledge)
    2 (acknowledge)
    So WHEN-MOUSE-DOUBLECLICK fires prior to WHEN-TREE-NODE-EXPANDED in my environment.
    Sergey.

  • Right click tree node

    Hello all,
    I need to process right click on the tree node. I can get the node and process the action well. But the problem is that the selected node doesn't have a gray box (selection indicator) like when I left click it.
    Please help me with this,
    Thanks,
    Fantabk

    Dear Siva,
    You can follow the following steps:-
    - Create local class (eg:- lcl_screen_handler) as handler class.
    - Define and implement methods handle_node_context_menu_req and handle_node_context_menu_sel for handling right click.
    - In Method handle_node_context_menu_req use CALL METHOD menu->add_function for adding entries to context menu.
    - In Method handle_node_context_menu_sel based on node_key and fcode handle logic for right click.
    - Define event handler (eg:- grc_event_handler     TYPE REF TO lcl_screen_handler) to handle events for right click on tree.
    - After creating Tree, specify events that are to be handled and assign them to tree instance
    eg:- lwa_event-eventid = cl_simple_tree_model=>eventid_node_double_click.
          lwa_event-appl_event = ' '.   "system event, does not trigger PAI
          APPEND lwa_event TO lit_event. (where, lit_event TYPE cntl_simple_events)
    - Also, register PAI for context menu as follows:-
    Process PAI if context menu select event occurs
      CALL METHOD grc_tree->set_ctx_menu_select_event_appl (where grc_tree is Tree instance)
        EXPORTING
          appl_event = 'X'.
    - Register Tree events as follows:-
    CALL METHOD grc_tree->set_registered_events
        EXPORTING
          events                    = lit_event ....
    - Create event handler instance for tree
      CREATE OBJECT grc_event_handler. (where, grc_event_handler is already declared on top)
    - Set event handler method to handle various events on tree node
    eg:-  SET HANDLER grc_event_handler->handle_node_double_click FOR grc_tree.
            SET HANDLER grc_event_handler->handle_node_context_menu_req FOR grc_tree.
            SET HANDLER grc_event_handler->handle_node_context_menu_sel FOR grc_tree.
    The events should be handled now. I have followed this approach and it worked for me.
    Regards,
    Ashish

  • On right click, the focus is not set on tree node.

    Dear members,
    I have a tree and a database block, when i right click on a tree node, the focus is not set on the node.
    If I first click on the node and then right click on selected node it populate the database block.
    But I want to populate the datablock on right click.
    how to implement it?
    Regards:

    No body ever encountered this problem?
    Any advice would be appreciated.
    Thanks

Maybe you are looking for

  • How Do I back up mail on my MacBook Pro after deleting it on my MacBook Air?

    Hello everyone! Recently I deleted some emails from my MacBook Air not realising that they would be deleted on my MacBook Pro.  When I realised what was going on I turned off the wifi on my Air and continued deleting. Basically I scrubbed just about

  • What's the best XML for JAVA?

    Hi There, My big question is what should I use for develop a normal XML document, that can: - contain BASE64 strings - support UTF-8 add attributes, etc. I then want to pick this document and: - do it's parsing (walk trough) - apply a xsl to this doc

  • Service error...  tried everything but doesn't work!!  Help please!

    I just got my brand new video ipod, and I can't even download anything!!! I installed the CD that came with the ipod. Ipod IS recognized by the windows, but not in iTunes. I see in the discussion that so many people had these errors... "ipod service

  • Running CM40 in the background

    Hi Gurus, I am having trouble scheduling CM40 in the background.  The way I want to use it is to dispatch according to specific work centers.  So I have a first variant that selects Redefine selection, lists an overall profile, Dispatch as the action

  • Content-length problem

    After upgraded into 8.1sp2, i met a new problem: <BEA-101083> <Connection failure. java.net.ProtocolException: Didn't meet stated Content-Length, wrote: '36648' bytes instead of stated: '36878' bytes <BEA-101104> <Servlet execution in servlet context