Solved

help with JPopUpMenu & JList

Posted on 2004-08-15
8
1,485 Views
Last Modified: 2012-08-13
Hi there,

I'm using NetBeans. I cant figure out how the JPopUpMenu comes on the panel. i have made a panel and when i click on JPopUpMenu and place it on the editor, i cant see anything. It just comes in the other components list . And it doesnt show any property.

The other question is about list. I need to make a dynamic List. The list is like that of MSN . Offline contacts, online contacts. Again the netbeans dont allow me to change the list members. do i have  to write some code for it.

plz help,

...
0
Comment
Question by:ganatra
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
8 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 11807505
I am not sure I understand what you mean by saying how the popup menu comes up. It shold be displaed when the user takes the appropriate action. For examples look here: http://javaalmanac.com/egs/javax.swing/Popup.html

For the list, you just create a list reference and then keep adding objects there:

List list = new ArrayList()
list.add("hello");
...

But I am not sure if we are talking about the same lists. What exactly is an MSN list?
0
 

Author Comment

by:ganatra
ID: 11851093
sorry Venabili..

actually i was waiting for some other comment. let me give some good hint..

every body must have seen the emoticons in msn or yahoo messenger.  when you click on the smiley box, a window opens with the list of smileys and let you choose the one you want. i want similar thing.. in java swing.

got it ?

plz help..
0
 
LVL 20

Expert Comment

by:Venabili
ID: 11851129
ganatra,

Noone will comment if they see that you had not answered to an expert trying to help you. In most cases this means that you do not care for the question (or that you still do not know how the site works). So for receiving faster and better responces, always answer to the experts trying to help you:)

So you need a popup with a table and not a list in it?
Can you post the code that you had written for the popup? How it is shown, how it is initiliased and so on?

Venabili
0
 

Author Comment

by:ganatra
ID: 11919463
here is the icon declaration..

ImageIcon myimage = new ImageIcon("C:\\abc.gif");

and here is the usage code.

jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {myimage, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jPanel1.add(jTable1);


now when i run this.. i get C:\abc.gif written in the table field and not hte image..

i need the image..

can u help..
0
 
LVL 35

Accepted Solution

by:
girionis earned 50 total points
ID: 11970798
Look here for examples of how you can put icons into jtable: http://www.senun.com/Left/Programming/Java_old/Examples_swing/JTableExamples8.html
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Unhandled exception type Exception 18 65
SequenceInputStream example 3 39
restrict decimal places for double datatype 10 50
Java array sort 10 63
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question