Showing posts with label right. Show all posts
Showing posts with label right. Show all posts

Sunday, January 15, 2017

How to create jTable right click popup menu Java Swing GUI

How to create jTable right click popup menu Java Swing GUI


jTable right-click popup menu Java Swing GUI - Mouse click
Java 2016
table_6.addMouseListener(new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent e)
{
int r = table_6.rowAtPoint(e.getPoint());
if (r >= 0 && r < table_6.getRowCount()) {
table_6.setRowSelectionInterval(r, r);
} else {
table_6.clearSelection();
}

//row index is found...
int rowindex = table_6.getSelectedRow();
if (rowindex < 0)
return;
if (e.isPopupTrigger() && e.getComponent() instanceof JTable ) {
JPopupMenu popup = createYourPopUp(rowindex,table_6);
popup.show(e.getComponent(), e.getX(), e.getY());
}
}

});
jTable right-click popup menu Java Swing GUI - Method
Java 2016
public static JPopupMenu createYourPopUp(int rowindex, JTable table_6)
{
JPopupMenu popup=new JPopupMenu();
JMenuItem edit=new JMenuItem("Edit Details");
JMenuItem delete=new JMenuItem("Delete Details");
edit.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
JOptionPane.showMessageDialog(null, "Edit scucessfuly");
}
});
delete.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
JOptionPane.showMessageDialog(null, "Delete scucessfuly");
}
});
popup.add(edit);
popup.add(delete);
return popup;
}






Available link for download

Read more »

Wednesday, January 11, 2017

How To Add Application Shortcut To Desktop Context Right Click Menu in Windows

How To Add Application Shortcut To Desktop Context Right Click Menu in Windows


Do you want to add your favorite application to desktop context menu ? If your answer is yes, then this post is for you. There are many third party software available to do the same, but I am not writing about them.

You can add any application to your desktop context menu by simply editing your registry. Just follow the simple steps to get it worked !

Steps
1. Press Windrows + R to open the Run box
2. Enter regedit in the open textfield and click OK
- It will open Registry Editor window
3. In Registry Editor expand HKEY_CLASSES_ROOTDirectoryBackgroundshell
4. Right click on the shell node click New > Key



5. Now name the newly created Key to your apps name or anything you wish, because this name will show on the context menu of desktop. I am named it Notepad++.



6. Now right click on the newly created key ( in my case NotePad++ ) and click New > Key



7. Name it to command



8. Now Right click on (Default) of command key and select Modify



9. Now Copy the full path of your favorite application to the Value data textfield.... Click OK

Note : To copy the full path of application. Go to application folder find the apps .exe file. Shift + Right Click on the exe and click Copy as path.




Thats it done ! Now Go and check by right clicking desktop you will see the added menu item in Context menu !


Available link for download

Read more »

Sunday, October 16, 2016

How to Enable TwoFingerTap as a Right Click in lenovo laptops Synaptic Touchpad Systems

How to Enable TwoFingerTap as a Right Click in lenovo laptops Synaptic Touchpad Systems


In some of the laptops which use synaptics  touchpad drivers, the TwoFingerTap doesnt work as a right click.Even after enabling this option in the Synaptics Control panel doesnt fix this problem.In this tutorial you will learn how to fix this problem & enable TwoFingerTap as a RightClick on Lenovo laptops.Im Performing this in Lenovoz510 which is loaded with Windows 10 operating system.But this method will work for every laptop which uses synaptics touchpad Driver.This will also work in Windows 8.1 platforms.



Steps-

1.Press Win+R keys to open run, type regedit and hit enter to open Registry Editor.

2.Go to "HKEY_CURRENT_USERSoftwareSynapticsSynTPTouchPadPS2". If you dont find "TouchPadPS2" and another entry named "TouchPadSMB2c" exists under SynTP then click on "TouchPadSMB2c". If you dont find "SynTP" key then read note at end of the post.

3.On the right double click on "MultiFingerTapFlags" entry and update its value to 3.

4.On the right double click on "2FingerTapAction" entry and update its value to 2.

5.  Press OK and Exit.

6. Restart your Laptop.

Note - If you dont find any of the above keys then you have to manually create it. Right Click on Synaptics click on New Key and Give it name ""SynTP". Now similarly create a key named "TouchPadPS2" under "SynTP". Now under "TouchPadPS2" create new "DWORD (32 bit) Value" with name "2FingerTapAction". Double Click it and Change its Value to 2. Logoff and Start Windows.

--------------------------------------------

REGARDS

Shankha Jana

.


Available link for download

Read more »