MIDP with Swing component

Hi!
I would like to know if it's possible to use swing components in the MIDP application. I have tried to do it with help of JBuilder5 but the application has crashed as soon as I ran it.
If MIDP doesn't support Swing, is there something else that can be used instead? Are there any plans to support Swing in the future?
I know the MIDP has very limited GUI components, but is it possible for example to use slider or scroll in a MIDP application.
Thanks,
/Einat

[EinatR],
Hi!
I would like to know if it's possible to use swing
components in the MIDP application. I have tried to do
it with help of JBuilder5 but the application has
crashed as soon as I ran it.MIDP does not support Swing. It provides 2 types of APIs - low level GUI APIs and High level GUI APIs. The High level GUI APIs will offer a consistent look and feel for GUI components across all MIDP compliant runtime environment.
If MIDP doesn't support Swing, is there something else
that can be used instead? Are there any plans to
support Swing in the future?Not that I know of, the Swing components are meant for systems and machines of the desktop and workstation hardware resource capabilities.
I know the MIDP has very limited GUI components, but
is it possible for example to use slider or scroll in
a MIDP application.Not that I know of, the limited screen size of MIDP devices are not suitable for Swing components such as sliders and scrolls that may take up more system resources which these small devices don't have.
Thanks,
/EinatHTH.
Allen Lai
Developer Technical Support
SUN Microsystems
http://www.sun.com/developers/support/

Similar Messages

  • Probleme with swing component and keyEvt

    hi ,
    I program this JFrame , when it is empty ( without the Jbutton ) the key Event works fine , but when I add the Jbutton the key event doesn't work anymore.
    I try some focus method but it doesn't seem to work , can you tell me what i can do ...
    Thx.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class test extends JFrame implements KeyListener
        private JButton jb_;
        public test() 
            setSize(320,200);
            this.addKeyListener(this);
            this.getContentPane().setLayout(null);
            jb_ = new JButton("button");
            jb_.setBounds(10,10,100,100);
            this.getContentPane().add(jb_);
        public void keyPressed(KeyEvent e) { System.out.println("OK"); }
        public void keyReleased(KeyEvent e) {}
        public void keyTyped(KeyEvent e) {}
        public static void main(String args[])
         test t = new test();
            t.setDefaultCloseOperation(EXIT_ON_CLOSE);
         t.show();

    i've solved it with creating a JTextArea and putting the button in there
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test extends JFrame implements KeyListener
         private JButton jb_;
         private JTextArea area;
         public Test()
              area = new JTextArea(200,200);
              area.setEditable(false);
              area.addKeyListener(this);
              jb_ = new JButton("button");
              jb_.setBounds(10,10,100,100);
              getContentPane().add(jb_);
              getContentPane().add(area);
              setSize(300,300);
         public void keyPressed(KeyEvent e)
              System.out.println("OK");
         public void keyReleased(KeyEvent e) {}
         public void keyTyped(KeyEvent e) {}
         public static void main(String args[])
              Test t = new Test();
              t.setDefaultCloseOperation(EXIT_ON_CLOSE);
              t.show();
    }

  • Flicker with heavyweight swing component and setVisible(false) on Linux

    Hi All,
    I'm using Java 6 update 14 on Ubuntu Jaunty.
    I'm developing a GUI for a system running linux. I'm using the Swing framework for the GUI but need to include 3D animation accelerated in hardware. I'm using the JOGL framework for applying the 3D animations which supplies one with two swing-like components, the GLJPanel and GLCanvas. These two components are lightweight and heavyweight swing components respectively.
    The difficulty arises when adding the heavyweight GLCanvas component into the gui. Often I need to do a setVisible(false) on the component in which case the GLCanvas hides correctly, but shows a flicker before the background is displayed. On digging a little deeper I found that because the GLCanvas is heavyweight, on linux it calls down to the sun.awt.X11 classes to do the setVisible(false) on hide. The very deepest call, the xSetVisible(false) method of the XBaseWindow class, causes the component to be replaced by first a grey backgound, and then the correct background. This intermediate grey background is causing the flicker.
    The source for the sun.awt.X11 packages was not available with the standard JDK 6 but I've found the open jdk source which matches the steps taken by the call. The xSetVisible method is as follows:
    0667:            public void xSetVisible(boolean visible) {
    0668:                if (log.isLoggable(Level.FINE))
    0669:                    log.fine("Setting visible on " + this  + " to " + visible);
    0670:                XToolkit.awtLock();
    0671:                try {
    0672:                    this .visible = visible;
    0673:                    if (visible) {
    0674:                        XlibWrapper.XMapWindow(XToolkit.getDisplay(),
    0675:                                getWindow());
    0676:                    } else {
    0677:                        XlibWrapper.XUnmapWindow(XToolkit.getDisplay(),
    0678:                                getWindow());
    0679:                    }
    0680:                    XlibWrapper.XFlush(XToolkit.getDisplay());
    0681:                } finally {
    0682:                    XToolkit.awtUnlock();
    0683:                }
    0684:            }I've found that the XlibWrapper.XFlush(XToolkit.getDisplay()) line (680) causes the grey to appear and then the XToolkit.awtUnlock(); line repaints the correct background.
    Using the lightwieght GLJPanel resolves this issue as it is a light weight component but unfortunately I'm unable to use it as the target system does not have the GLX 1.3 libraries required because of intel chipset driver issues (it has GLX 1.2). I cannot enable the opengl pipline either (-Dsun.java2d.opengl=True) for the same reason.
    Is there a way to configure a heavyweight component to avoid the operation in line 680? As far as I can tell, the flicker would disappear and the display would still be correctly rendered had this line not been executed. This problem is not present in windows.
    I've put together a minimal example of the problem. It requires the JOGL 1.1.1 libraries in the classpath. They can be found here: [JOGL-download|https://jogl.dev.java.net/servlets/ProjectDocumentList?folderID=11509&expandFolder=11509&folderID=11508]
    I've also found that running the program with the -Dsun.awt.noerasebackground=true vm argument reduces the flicker to just one incorrect frame.
    The program creates a swing app with a button to switch between the GLCanvas and a normal JPanel. When switching from the GLCanvas to the JPanel a grey flicker is noticeable on Linux. Step through the code in debug mode to the classes mentioned above to see the grey flicker frame manifest.
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Insets;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.media.opengl.GLCanvas;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JInternalFrame;
    import javax.swing.JPanel;
    import javax.swing.WindowConstants;
    import javax.swing.border.EmptyBorder;
    public class SwitchUsingJInternalFrameSwappedExample {
         private static JPanel glPanel;
         private static JPanel mainPanel;
         private static JPanel swingPanel1;
         private static boolean state;
         private static JInternalFrame layerFrame;
         private static GLCanvas glCanvas;
         public static void main(String[] args) {
              state = true;
              JFrame frame = new JFrame();
              frame.setSize(800, 800);
              frame.setContentPane(getMainPanel());
              frame.setVisible(true);
              frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
              frame.setBackground(Color.GREEN);
         // The main component.
         public static JPanel getMainPanel() {
              mainPanel = new JPanel();
              mainPanel.setBackground(new Color(0, 0, 255));
              mainPanel.setBorder(new EmptyBorder(new Insets(20, 20, 20, 20)));
              mainPanel.setLayout(new BorderLayout());
              mainPanel.add(getButton(), BorderLayout.NORTH);
              mainPanel.add(getAnimationPanel(), BorderLayout.CENTER);
              return mainPanel;
         // Switch button.
         private static JButton getButton() {
              JButton button = new JButton("Switch");
              button.addActionListener(new ActionListener() {
                   @Override
                   public void actionPerformed(ActionEvent e) {
                        switchToOpenGl();
              return button;
         // Do the switch.
         protected static void switchToOpenGl() {
              // Make the OpenGL overlay visible / invisible.
              if (!state) {
                   glCanvas.setVisible(false);
              } else {
                   glCanvas.setVisible(true);
              state = !state;
         // Normal swing panel with buttons
         public static JPanel getNormalPanel() {
              if (swingPanel1 == null) {
                   swingPanel1 = new JPanel();
                   for (int i = 0; i < 10; i++) {
                        swingPanel1.add(new JButton("Asdf" + i));
                   swingPanel1.setBackground(Color.black);
              return swingPanel1;
         // Extra panel container just for testing whether background colors show through.
         public static JPanel getAnimationPanel() {
              if (glPanel == null) {
                   glPanel = new JPanel(new BorderLayout());
                   glPanel.setBorder(new EmptyBorder(new Insets(20, 20, 20, 20)));
                   glPanel.setBackground(Color.YELLOW);
                   glPanel.add(getLayerFrame(), BorderLayout.CENTER);
              return glPanel;
         // A component that has two layers (panes), one containing the swing components and one containing the OpenGl animation.
         private static JInternalFrame getLayerFrame() {
              if (layerFrame == null) {
                   // Create a JInternalFrame that is not movable, iconifyable etc.
                   layerFrame = new JInternalFrame(null, false, false, false, false);
                   layerFrame.setBackground(new Color(155, 0, 0));
                   layerFrame.setVisible(true);     
                   // Remove the title bar and border of the JInternalFrame.
                   ((javax.swing.plaf.basic.BasicInternalFrameUI) layerFrame.getUI())
                             .setNorthPane(null);
                   layerFrame.setBorder(null);
                   // Add a normal swing component
                   layerFrame.setContentPane(getNormalPanel());
                   // Add the OpenGL animation overlay on a layer over the content layer.
                   layerFrame.setGlassPane(getGLCanvas());
              return layerFrame;
         // OpenGL component.
         public static GLCanvas getGLCanvas() {
              if (glCanvas == null) {
                   glCanvas = new GLCanvas();
                   glCanvas.setBackground(Color.CYAN);
              return glCanvas;
    }

    Oracle employees typically don't read these forums, you can report bugs here: http://bugs.sun.com/bugdatabase/

  • Swing component's margin in a frame

    Hello all,
    When you set the bounds of a Swing component in a frame, it will automatically apply those bounds to the VISIBLE part of the frame, so that, a Y value of 0, for example, will not be at the very top of the frame, but right underneath the title bar of the frame. If you give a regular AWT a value of 0 to it's Y coordinate, part (or all) of it will be covered by the title bar of the frame. This does not happen with Swing components, which automatically add the height of the title bar to the value you give to their Y coordinate.
    Now, what I want to know is, how can I retrieve the value of that "automatic margin"?. How can I know the number of pixels that the Swing component is being slided down, in order to save the title bar of the frame? This value can not be constant, since it will differ from one platform to another, and from one Look 'n Feel to another, but I have not been able to find out the way to get the value that it's being applied in each case.
    As allways, many thanks in advance for your help.

    Don't know if there is any direct way to get this information. But, assuming the border width/height is equal on all four sides you could try something like:
    Dimension frameD = frame.getSize();
    Dimension contentD = frame.getContentPane().getSize();
    int borderWidth = frameD.width - contentD.width;
    int titleHeight = frameD.height - contentD.height - borderWidth;

  • GC doesn't seem to work properly with Swing components

    Well, I have a problem, and it's quite a big deal.
    I don't understand why the java GC refuses to free the memory.
    I have made a VERY LITTLE example, so that everybody will see what the problem is made with.
    a frame with 2 buttons. the first one make another frame appears, which contains a quite big Swing component. The other is here in order to try to free the memory of this frame.
    Here are the 2 classes :
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class FirstClass extends JFrame{
    private JButton jButton1 = new JButton("free memory");
    private JButton jButton2 = new JButton("load frame");
    private MyFrameColor frame;
    public FirstClass() {
    jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mouseClicked(MouseEvent e) {
    jButton1_mouseClicked(e);
    jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mouseClicked(MouseEvent e) {
    jButton2_mouseClicked(e);
    this.getContentPane().add(jButton1, BorderLayout.NORTH);
    this.getContentPane().add(jButton2, BorderLayout.SOUTH);
    this.show();
    public static void main(String[] args)
    new FirstClass();
    import javax.swing.*;
    import java.awt.*;
    public class MyFrameColor extends JFrame {
    JColorChooser jColorChooser1 = new JColorChooser();
    public MyFrameColor() {
    this.getContentPane().add(jColorChooser1, BorderLayout.CENTER);
    the problem is that, according to the Windows task Manager the memory isn't freed after having pressed on "free memory" button.
    Moreover, in my real application, there are so much data that aren't freed this way, that, at the third launching of a frame, I have a Out of Memory exception !
    THank you for answering
    Have a good day :-)

    First, obviously you didnt include all the code. And the most important part(the references to the classes in question) are missing. How can we make a judgement?
    Second, the windows taskbar is no measure of how much memory your program is using, its a measure of how much memory the JVM is using. You didnt write the JVM so you really should not be concerned with that.
    1. Try using System.freemem() or some similar call to see what your program is actually using.
    2. Try making the GC verbose to see when it actually reclaims objects
    3. Try calling the GC to force a little GC before you check the memory.
    4. Try calling UpdateUI if it actually shows that your memory is really not being released.

  • How to set a Swing component as Modal window on a SWT Component.?

    How to set a Swing component as Modal on a SWT Component.I mean, I have a window (SWT Container) with some menu items.
    When I click on one menu item then i will get one new Swing Window.
    When creating the new frame I had passed Modal value as TRUE in the constructer.Now child is not behaving as Modal Window.I mean I am able to go to parent window even though the child window is opened as a Modal Window.This is only happened when I double click on the Title Bar of the Parent Window.
    If I try to click on any other part of the Parent Window except Title bar ... the child window is working as a Modal Window.
    Can any one suggest me to solve this one !!

    int this case, do this :
    JFrame f = new JFrame("Authentification");
    f.getContentPane().setLayout(new BorderLayout());
    f.getContentPane().add(myJPanel, BorderLayout.CENTER);
    f.setBounds(x,y,w,h);
    f.setVisible(true);
    Where myJPanel is the Panel you developped.

  • How to set a Swing component as Modal on a SWT Component?

    How to set a Swing component as Modal on a SWT Componen?.I mean, I have a SWt Component window and from that window I am displaying a SWING Component Modal window.
    The problem is my swing window is not working as Modal always.
    When I opened the swing window from SWT window,swing window is working as Modal.But if Idouble click on Menubar or Title bar of the SWT Window then my Swing window goes back.If I click on any other part of the SWT window.. then once again Swing window is working as modal.
    Can any one suggest me to solve this?
    I think this is isuue related with Swing over SWT..

    pradeep.rajadurai wrote:
    I want set the JTable as a background of jframe or jinternalframe , how it is possible One way that may work, you can always extract the image from a rendered JTable and then paint the same image into the JPanel that holds your components via it's paintComponent method, then added the JPanel to the app's contentPane.
    give me simple pgmIs English your second language? Because if so, please understand that this demand can be taken by some as rude.

  • Support for Multilingual Numeral Input in JTextField swing component

    When the User Locale is changed from the regional & language options in the control panel and the standard digits are customized to a non Latin character set, all the windows applications adhere to the changes made. HTML also respects the changes in effect and displays any numeric values using the new character set, which are the national digits for many Eastern Locales such as Chinese, Arabic(Saudi Arabia), Urdu and many more. The JTextField swing component given by java, however, does not show any support to the new settings. Any numeric input is displayed in the Latin character set even when the input locale of the system is also changed respectively. Any text input for this case is correctly displayed in the desired literals and appropriate glyphs. However, unlike the AWT components, numeral input and display is not catered as per the user/developer's requirements. This behavior was first noticed in 2007, as far as i have found out, and was reported once again on the same thread in 2010. The thread is given below as a reference. No action or response has been taken. Kindly look into this matter and please let me know if this bug has been reported before and if there is any intent of providing a fix for it.
    Reference: http://www.coderanch.com/t/344075/GUI/java/Multilingual-support-JTextField
    Regards,
    Aitzaz Ahmad
    Software Engineer
    SENSYS

    I too had an itch to reply with something like this
    This is a sign of work well done!
    The WD has so strong UI abstraction, that hides client-server nature applications almost completely. If you search forum, you will even find posts where developers try to upgrade value of ProgressMeter in <b>for</b> loop )
    VS

  • JMenu with AWT component

    dear friends;
    i have added menu bar in Jframe which is containes menues.
    AWT component is added the the same frame .
    problem is:
    menues are overlapping with awt component while i clicked the menu bar.
    dear friends help me immediately.
    thank u

    dear friends help me immediately.It's your own fault or combining Swing and AWT widgets. You're not supposed to do that, as it can lead to strange effects. Like this one.

  • Can't add to JPanel after removeAll() is triggered by another swing compone

    Consider the bit of code below. It's a much simplified version of my real app.
    In jPanel1 is a single label. In jPanel2 is a single button.
    The button in jPanel2 is supposed to wipe clear (with removeAll()) jPanel1 and add a new label in place of the old one. What actually happens is that after the first button press, jPanel1 is indeed cleared by the removeAll() method but the new label can't be added (or rather it can be added but won't show.) I can hard code the removal & addition back and forth all day & it works fine. It's just when I use a swing component like JButton or JComboBox that it doesn't work. Why?? Is this a thread thing? (I know I can just change the text of the label but the real app is much more complicated.)
    package my.stuff;
    import java.awt.*;
    import javax.swing.*;
    public class TreeTest3 extends javax.swing.JFrame {
         private String language = "english";
         public TreeTest3() {
              initComponents();
              jPanel1.setLayout(new FlowLayout());
              jPanel1.setVisible(true);
              changeLabel();
         private void changeLabel()
              System.out.println("language = " + language);
              jPanel1.removeAll();
              jPanel1.validate();
              jPanel1.add(new JLabel(language), "Center");
              repaint();
         @SuppressWarnings("unchecked")
            // <editor-fold defaultstate="collapsed" desc="Generated Code">
            private void initComponents() {
                    jPanel1 = new javax.swing.JPanel();
                    jPanel2 = new javax.swing.JPanel();
                    jButton1 = new javax.swing.JButton();
                    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
                    jPanel1.setBorder(new javax.swing.border.MatteBorder(null));
                    jPanel1.setPreferredSize(new java.awt.Dimension(400, 204));
                    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
                    jPanel1.setLayout(jPanel1Layout);
                    jPanel1Layout.setHorizontalGroup(
                            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGap(0, 398, Short.MAX_VALUE)
                    jPanel1Layout.setVerticalGroup(
                            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGap(0, 133, Short.MAX_VALUE)
                    jButton1.setText("switch");
                    jButton1.addActionListener(new java.awt.event.ActionListener() {
                            public void actionPerformed(java.awt.event.ActionEvent evt) {
                                    jButton1ActionPerformed(evt);
                    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
                    jPanel2.setLayout(jPanel2Layout);
                    jPanel2Layout.setHorizontalGroup(
                            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                    .addContainerGap()
                                    .addComponent(jButton1)
                                    .addContainerGap(308, Short.MAX_VALUE))
                    jPanel2Layout.setVerticalGroup(
                            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                    .addContainerGap()
                                    .addComponent(jButton1)
                                    .addContainerGap(126, Short.MAX_VALUE))
                    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
                    getContentPane().setLayout(layout);
                    layout.setHorizontalGroup(
                            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    layout.setVerticalGroup(
                            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    pack();
            }// </editor-fold>
         private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
              if (language.equals("english")) language = "spanish"; else language = "english";
              changeLabel();
         public static void main(String args[]) {
              java.awt.EventQueue.invokeLater(new Runnable() {
                   public void run() {
                        new TreeTest3().setVisible(true);
            // Variables declaration - do not modify
            private javax.swing.JButton jButton1;
            private javax.swing.JPanel jPanel1;
            private javax.swing.JPanel jPanel2;
            // End of variables declaration
    }

    It should be
                    private void changeLabel()
              System.out.println("language = " + language);
              jPanel1.removeAll();
              jPanel1.add(new JLabel(language), "Center");
              jPanel1.revalidate();
              jPanel1.repaint();
         }

  • Can i use EJB with Swing?

    Hi,
    I am developing an application in which i am using the "Swing" for GUI.Can i use the "EJB" with swing?
    regards

    Hi,
    Sure you can. The earlier poster has said the same thing too. Just that hes made out like this is possible only in jboss. EJB is a distributed component framework and can support multiple types of clients. The client can be a servlet or jsp, another EJB or in your case a swing application. In fact many IDE's allow you to test your EJB called by generating an application client. You need to add a special application client deployment descriptor file ( atleast with weblogic) in order to do this.
    Hope this helps.
    cheers,
    vidyut
    http://www.bonanzasoft.com

  • How to embed swing component into javaFX ?

    Maybe I missed sth, but can someone explain us how can we embed swing component into javaFX 2.0 ?
    This was previously handled with javaFX "srcipt", why can't we do it anymore ?
    As far as the work to migrate from 1.3 to 2.0 is hard and huge, why do fx2.0 do not offer such feature anymore ? :(
    I know that ThingFx project try to cope with, but the current code doesn't match with my needs.
    Thanks for help,
    Edited by: tibO on 23 nov. 2011 14:35

    I know this post is old and the original authors might not even ben active; but it essentiall gets to the heart of what I'm trying to.
    I have a JDialogBox. In it I have a panel (which I have to change to a JScrollPane). Inside the JPanel I have a JLabel and a JTextArea.
    I was told to; make it scrollable in the event that there is too much info for the JDialogBox and to add HTML formatting (simple stuff like bold and colors.
    1) The JScrollBar doesn't seem to produce the scroll side bars.
    2) I must not be implementing the JEditorPane correctly. I just substituted JEditorPane for JTextArea in my code and it returned a type converstion error. Is JEditorPane even the correct object to use? Should I be using JTextPane?
    The reason I can't do this on a JLabel by JLabel basis is because I don't know how many labels I will need at each runtime. And I also have to have a swingtimer on it. I could create an array and loop around it to create the JLabels. But it seems a waste of commuting cycles. This is no good?

  • New Swing Component for Swing Palette in NetBeans

    Hi guys,
    I want to write a new Swing component (Bean) for drawing vertical and horizontal lines to use with netBeans GUI designer.
    Could anyone direct me to a tutorial
    thanks in advance

    JTextcomponent.

  • Which Swing component could load a picture just like picturebox in VB?

    Dear all:
    I need show a picture on the wihdow I programmed with Swing,yet I did not know which component can load a picture just like picturebox in Visual Basic.If you knew about,please tell me.Thanks.
    Kindly regards!

    The "bold" tags are used to highlight important words or phrases in your question, not the entire question.
    I don't know what a "picture box" is so I'll just point you to the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html#popup]A Visual Index to Swing Components. Many components support images.

  • Hotel Menu Like Swing Component

    Hi , I need a swing component which has the functionality as below
    Initially, its looks like this
    # Beverages
    # Starters
    # MainCourse
    # Deserts
    When the user clicks on > it should expand that menu item and show the individual items along with their icons.
    # Beverages
           icon1 Tea
           icon2 Ice Tea
           icon3 Soft drink
    # Starters
    # MainCourse
    # Deserts
    Is there any readily available swing component which I can use for this behavior ?
    It is ok even the swing component misses out expand functionality when the "#" is clicked.

    But how can I set the icons to what I need ? Read the tutorial!!!
    There is no way you could have read the tutorial and understand how a JTree works in 10 minutes.
    So do some work on you own. Read the tutorial. Search the forum for examples.
    We've pointed you in the right direction so do some learning on your own.

Maybe you are looking for

  • IPhoto cannot import your photos because there was a problem downloading an image.

    Running Mac OS X Lion 10.7.5 on MacBook Air and Iphoto '09 version 8.1.2 on iphone 5. Keep getting the "iPhoto cannot import your photos because there was a problem downloading an image" error message. Is this related to HDR photos or videos? What ca

  • MSG.EXE Error 1722 getting session names?

    I have a vista and whenever I send msg to someone else on my "workgroup" it says "Error 1722 Getting session names. I tried msg /?. It sends a message to myself though... ("msg /server:COMPUTERNAME USERNAME "MESSAGE")

  • 6288 - Photos download to different sizes using No...

    When I downloaded around 70 photos to my PC recently the images were automatically saved at varying sizes. For example, using the slide show function some were full screen whilst others were 'stamp' sized and others half-screen??? Was it something to

  • HT4759 how can I transfer files to my iPad from my mac when tethered

    I've benn a mac user for many years.  My job provides iPhones and I'm trying to use my wifes old iPad to carry work files and email. My ipad won't sync like the phone and mac are. Can I transfer files manually when tethered? My second question is the

  • Transfer Order Splitting By Picking Area

    Hi, Appreciate some help on this one. Our system is currently set to split picking transfer orders by storage type -       I'm trying to switch this off. Instead I would like to split by picking area, so if I have say, picking area 001 across 2 stora