Click here to Skip to main content
15,908,264 members
Home / Discussions / Java
   

Java

 
AnswerInappropriate Title Pin
fly9047-Jun-09 10:32
fly9047-Jun-09 10:32 
GeneralI am getting the error when I try to execute a Query. Error retrieving data:1 java.sql.SQLException: [Macromedia][Oracle JDBC Driver]Value can not be converted to requested type.Exception in DBAccessor:formatResults java.sql.SQLException: [Macromedia Pin
ummadu5-Jun-09 10:40
ummadu5-Jun-09 10:40 
GeneralI am getting the error when I try to execute a Query. Error retrieving data:1 java.sql.SQLException: [Macromedia][Oracle JDBC Driver]Value can not be converted to requested type.Exception in DBAccessor:formatResults java.sql.SQLException: [Macromedia Pin
ummadu5-Jun-09 10:40
ummadu5-Jun-09 10:40 
GeneralError getting column type Pin
fly9047-Jun-09 10:41
fly9047-Jun-09 10:41 
Questionclient server communication Pin
dumnbncool5-Jun-09 7:21
dumnbncool5-Jun-09 7:21 
QuestionBackground dimmer Pin
EnchantedSun5-Jun-09 3:56
EnchantedSun5-Jun-09 3:56 
QuestionProblem with JSObject Pin
raesa5-Jun-09 2:44
raesa5-Jun-09 2:44 
QuestionJava Swing - Right Click and JPopupMenu in JTable Pin
djDash5-Jun-09 0:25
djDash5-Jun-09 0:25 
I want a different popup on each row of JTable.
So I thought of setting the row on right click and then add popmenu to JTable.
The following code will help you'll to understand the problem...

private synchronized void HandlePopup(java.awt.event.MouseEvent evt) {                            
            jTable1.setComponentPopupMenu(null);
            if(evt.getButton()==MouseEvent.BUTTON3){
               int y = evt.getY();
               int row = Math.round(y / jTable1.getRowHeight());
               jTable1.setRowSelectionInterval(row, row);               
               System.out.println("Row Selected = " + row);
               jTable1.setComponentPopupMenu(popupMenu);
           }
           else jTable1.setComponentPopupMenu(null);
    }                            

    private void CreatePopup() {
        // Create popup menu, attach popup menu listener
        popupMenu = new JPopupMenu("Title");

        // Cut
        JMenuItem cutMenuItem = new JMenuItem("Cut");
        popupMenu.add(cutMenuItem);

        // Copy
        JMenuItem copyMenuItem = new JMenuItem("Copy");
        popupMenu.add(copyMenuItem);
        // Paste
        JMenuItem pasteMenuItem = new JMenuItem("Paste");
        pasteMenuItem.setEnabled(false);
        popupMenu.add(pasteMenuItem);

        // Separator
        popupMenu.addSeparator();

        // Find
        JMenuItem findMenuItem = new JMenuItem("Find");
        popupMenu.add(findMenuItem);        
    }

Smile | :)

Here for the first right click the row gets selected....
then only the popup works and then there is no row selection.
the pop is always the same...coz new row gets never selected...
So how can I handle both popup with right selection...???
Please help me with this...
QuestionRe: Java Swing - Right Click and JPopupMenu in JTable Pin
Java John11-Jun-09 1:59
Java John11-Jun-09 1:59 
QuestionCreating a file and saving it on a networked computer [modified] Pin
ItIsFinished4-Jun-09 12:00
ItIsFinished4-Jun-09 12:00 
AnswerRe: Creating a file and saving it on a networked computer [modified] Pin
darkdragn5-Jun-09 2:45
darkdragn5-Jun-09 2:45 
GeneralRe: Creating a file and saving it on a networked computer Pin
ItIsFinished5-Jun-09 5:44
ItIsFinished5-Jun-09 5:44 
QuestionWriting a simple HTML report using Java Pin
raesa3-Jun-09 20:15
raesa3-Jun-09 20:15 
AnswerRe: Writing a simple HTML report using Java Pin
Ali Shakiba10-Jun-09 22:19
Ali Shakiba10-Jun-09 22:19 
Questionneed help geeting a nullpointerexeption [modified] Pin
ashish_bhatia3-Jun-09 1:07
ashish_bhatia3-Jun-09 1:07 
AnswerRe: need help geeting a nullpointerexeption Pin
Nagy Vilmos3-Jun-09 2:00
professionalNagy Vilmos3-Jun-09 2:00 
RantRe: need help geeting a nullpointerexeption [modified] Pin
ItIsFinished4-Jun-09 12:13
ItIsFinished4-Jun-09 12:13 
GeneralRe: need help geeting a nullpointerexeption Pin
Nagy Vilmos5-Jun-09 3:46
professionalNagy Vilmos5-Jun-09 3:46 
QuestionMobile Application Pin
cdpace2-Jun-09 23:40
cdpace2-Jun-09 23:40 
AnswerRe: Mobile Application Pin
Nagy Vilmos3-Jun-09 0:08
professionalNagy Vilmos3-Jun-09 0:08 
Questionretrieving selected item from jComboBox in jTable Pin
Denis J. González1-Jun-09 9:16
Denis J. González1-Jun-09 9:16 
AnswerRe: retrieving selected item from jComboBox in jTable Pin
darkdragn1-Jun-09 9:25
darkdragn1-Jun-09 9:25 
GeneralRe: retrieving selected item from jComboBox in jTable Pin
Denis J. González1-Jun-09 9:43
Denis J. González1-Jun-09 9:43 
QuestionMobile Programming Pin
Sourie30-May-09 19:28
Sourie30-May-09 19:28 
AnswerRe: Mobile Programming Pin
raheela12331-May-09 1:22
raheela12331-May-09 1:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.