Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

help with JPopUpMenu & JList

Posted on 2004-08-15
8
Medium Priority
?
1,494 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 200 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

721 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