JLabel to hear ActionEvents?

I'm writing a GUI prototype in a team for a project. In our paper-design we used quite a few "hyperlinks" and assumed that we would be able to just use JLabels and add an ActionListener.
It's now that we've found out addActionListener() doesn't exist in JLabel and need a way for a JLabel to know if it's been clicked or to find a similar component which can provide this behaviour.
JLabel can accept HTML as its label and also hyperlinks in that text, is there any way of finding out if one of those hyperlinks was clicked?
I looked a JMenuItem but can't override it's background colour or centre alignment.
I tried extending JAbstractButton and using setLabel to no avail.
I'd really appreciate any suggestions to solve this problem quickly.
Thanks
Alex Ellis

I'd really appreciate any suggestions to solve this problem quickly.Searching the forum before posting is always a good idea.
I used "hyperlink label" to search the forums and found several suggestions.

Similar Messages

  • Draw image icon on JLabel

    Does anyone know how I can paint an icon on an already existing JLabel image without having the original image disappear partially or completely?
    The way I have it set up right now is that the original image listens to MouseListener, and displays information on a textArea when I click on the map.
    What I wish to do is to display an icon on the map image whenever I click on it.
    I'm a rather amateur with Java, and don't know how to make interfaces interact with eachother, no matter how hard I try. I need to know if I can add something to my current code to get what I want. I have had tried to interact different classes with eachother, but I haven't been getting what I wanted. Please help me out!
    I know how to display the icon on another panel, and make it move. but not on the same panel on the original picture.
    Here's my code:
    package screem.netrol.communication.event;
    * @author Nazli
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.Component;
    import java.awt.Image;
    import java.awt.Color;
    import javax.swing.*;
    import javax.swing.ImageIcon;
    import java.net.*; // For class URL.
    import java.awt.event.MouseListener;
    import java.awt.event.MouseEvent;
    import java.io.*;
    import java.util.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.border.TitledBorder;
    import javax.swing.event.MouseInputAdapter;
    import java.applet.*;
    public class MyMapPanel extends JPanel implements DataTurbineListener, MouseListener, ImageObserver
    final static String newline = "\n";
    JTextArea textArea; //= new JTextArea();
    public static String url;
    public static ImageIcon ic;
    public static ImageIcon ic2 = new ImageIcon("http://www-jkn.ee.uec.ac.jp/tnklab/96/nakazawa/icons/colorball/small/BALL120.gif");
    public static JLabel mapArea;
    //public static JApplet mapArea;
    //public static File output = new File("results.txt");
    public static boolean showPoint;
    public static int x;
    public static int y;
    private BufferedImage bufImg ;
    private Image smallImg ;
    int w;
    int h;
    /*public static BufferedImage bufImg ;
    public static Image smallImg ; */
    /* GeneralPath path;
    final int PAD = 20;
    final int N = 8; */
    public static MyJFrame f;
    public MyMapPanel() {}
    public MyMapPanel(ImageIcon ic)
    super(new FlowLayout (FlowLayout.CENTER, 0,0));
    textArea = new JTextArea();
    setImageIcon(ic);
    textArea.setEditable(false);
    JScrollPane scrollPane = new JScrollPane(textArea);
    add(scrollPane);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    scrollPane.setPreferredSize(new Dimension(700,100));
    //getContentPane().add(new MyPanel(), BorderLayout.CENTER);
    //addMouseListener( new MusClk() ) ;
    protected class MusClk extends MouseAdapter {
    public void mouseClicked ( MouseEvent musEvt ) {
    if( musEvt.getX() > bufImg.getWidth() || musEvt.getY() > bufImg.getHeight() ) {
    return ;
    Graphics g = bufImg.getGraphics() ;
    int w = smallImg.getWidth( null ) ;
    int h = smallImg.getHeight( null ) ;
    g.drawImage( smallImg , musEvt.getX() - w / 2 , musEvt.getY() - h / 2 , null ) ;
    MyMapPanel.this.repaint( musEvt.getX() - w / 2 , musEvt.getY() - h / 2 , w , h ) ;
    public ImageIcon getImageIcon()
    setImageIcon(ic);
    return ic;
    public void setImageIcon(ImageIcon ic)
    //MyPanel panel = new MyPanel();
    try{
    URL u = new URL(url);
    ic = new ImageIcon(u);
    } catch (MalformedURLException e) {
    System.out.println (e);
    mapArea = new JLabel(ic, JLabel.CENTER);
    add(mapArea);
    mapArea.addMouseListener(this);
    try {
    URL u = new URL(url);
    ic = new ImageIcon(u);
    } catch (MalformedURLException e){
    System.out.println(e);
    mapArea = new JApplet();
    add(mapArea);
    mapArea.addMouseListener(this); */
    /* public void setMouseEvent(MouseEvent e)
    x = e.getX();
    y = e.getY();
    showPoint = true;
    protected void paintComponent(Graphics g){ }
    public void dataTurbineOutputEvent(DataTurbineEvent event){}
    public void dataTurbineInputEvent(DataTurbineEvent event){}
    public void mouseReleased(MouseEvent e){}
    public void mousePressed(MouseEvent e) { }
    public void mouseEntered(MouseEvent e) {}
    public void mouseExited(MouseEvent e) { }
    public void mouseClicked(MouseEvent e)
    //setMouseEvent(e);
    //System.out.println("x="+x+" y="+y);
    showPoint = true;
    ImageIcon icon = new ImageIcon("C:/Documents and Settings/Nazli/My Documents/My Pictures/ball.gif");
    w = icon.getIconWidth();
    h = icon.getIconHeight();
    bufImg = new BufferedImage(w , h , BufferedImage.TYPE_INT_RGB ) ;
    Graphics g = bufImg.getGraphics();
    g.drawImage( icon.getImage() , 0 , 0 , null ) ;
    //MyMapPanel.this.repaint(e.getX() - w / 2 , e.getY() - h / 2 , w , h ) ;
    /*Point p = e.getPoint();
    Rectangle tag;
    final int SIDE = 6;
    tag = new Rectangle(0, 0, SIDE, SIDE);
    float x = e.getX();
    float y = e.getY();
    tag.setLocation(p.x - SIDE/2, p.y - SIDE/2);
    if(tag.contains(p.x,y))
    showPoint = true;
    setPoint(p);
    //System.out.println("e.getX="+e.getX()+""+"e.getY="+e.getY());
    saySomething("Position in pixels:(" + e.getX() + ", " + e.getY() + ")", e);
    String s1 = computeLatLong(e.getX());
    String s2 = computeLatLong(e.getY());
    saySomething("Position in Lat/Long: (" + s1 + ", " + s2 + ")", e);
    //g.drawImage(img, e.getX(), e.getY(), this);
    //DrawImage d = new DrawImage();
    //public void mouseClicked ( MouseEvent musEvt ) {
    //DrawImage d = new DrawImage();
    void saySomething(String eventDescription, MouseEvent e)
    textArea.append(eventDescription + " detected on " + e.getComponent().getClass().getName() + "." + newline);
    textArea.setCaretPosition(textArea.getDocument().getLength());
    public String computeLatLong(double d)
    double d1;
    double seconds;
    double minutes;
    double m;
    double s;
    String rval;
    d1 = d - Math.floor(d);
    seconds = d1 / 3600;
    minutes = seconds / 60;
    m = minutes - Math.floor(minutes);
    s = m * 60; //minutes converted to seconds
    rval = (int)Math.floor(d) + "deg " + (int)minutes + "' " + (int)s + '"';
    return rval;
    public MyJFrame getFrame()
    return f;
    public static void main(String[] args) throws IOException {
    //DrawImage d = new DrawImage();
    System.out.println("x="+x+" y="+y);
    ArrayList file = new ArrayList();
    File input = new File("lat_lon.txt");
    FileReader in = new FileReader(input);
    File output = new File("archive3.txt");
    FileWriter out = new FileWriter(output);
    //FileWriter in2 = new FileWriter(input);
    FileOutputStream outdata = new FileOutputStream(output);
    PrintStream p = new PrintStream(outdata);
    BufferedReader br = new BufferedReader(in, 4096);
    BufferedWriter bw = new BufferedWriter(new FileWriter("lat_lon.txt", true));
    String line; //each line in input file
    String s=null; //Main string containing points information, to be written to the output file
    while ((line = br.readLine()) != null )
    file.add(line);
    StringTokenizer st = new StringTokenizer(line,";");
    while(st.hasMoreTokens())
    s = st.nextToken();
    p.println(s);
    p.println("FINISHED DATA TRANSFER");
    p.println("\n");
    bw.write("DATA TRANSFERRED TO OUTPUT FILE");
    bw.newLine();
    bw.flush();
    p.close();
    //pops up the input dialogue window for the user to enter the image URL
    url = JOptionPane.showInputDialog(null,"Provide image URL:\n","Map Image", JOptionPane.PLAIN_MESSAGE);
    MyMapPanel panel = new MyMapPanel();
    if(url != null)
    panel.setImageIcon(ic);
    MyMapPanel mp = new MyMapPanel(ic);
    MyPanel panel2 = new MyPanel();
    //MyMapPanel mp2 = new MyMapPanel();
    JFrame jf = new JFrame();
    f = new MyJFrame(700,400);
    f.getContentPane().add(mp);
    //f.getContentPane().add(panel2);
    public static class MyJFrame extends JFrame {
    // Constructor.
    public MyJFrame (int width, int height)
    // Set the title and other frame parameters.
    this.setTitle ("GPS Map");
    this.setResizable (true);
    this.setSize (width, height);
    // Create and add the panel.
    MyMapPanel panel = new MyMapPanel();
    //MyPanel p = new MyPanel();
    //this.getContentPane().add (panel);
    this.getContentPane().add(panel);
    // Show the frame.
    this.setVisible (true);
    }

    Hi,
    I'm sorry that I didn't use the buttons to make the code readable for you. and I'm sure you don't want to hear how hectic my mind has been for the past few weeks, so I'm not going to explain why I didn't pay attention to the formatting. Although, I think it could have been possible to address my mistake in a less aggressive manner.
    Here's my code in a better readable format. I appreciate your advice, it looks so much better now. I'd very much appreciate it if you can go over it.
    In regards to your previous solution, I have to say that I've tried it before, but it hasn't worked for me, possibly because I'm not sure how to use it.
    * @author Nazli
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.Component;
    import java.awt.Image;
    import java.awt.Color;
    import javax.swing.*;
    import javax.swing.ImageIcon;
    import java.net.*; // For class URL.
    import java.awt.event.MouseListener;
    import java.awt.event.MouseEvent;
    import java.io.*;
    import java.util.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.border.TitledBorder;
    import javax.swing.event.MouseInputAdapter;
    import java.applet.*;
    public class MyMapPanel extends JPanel implements DataTurbineListener, MouseListener, ImageObserver
    final static String newline = "\n";
    JTextArea textArea; //= new JTextArea();
    public static String url;
    public static ImageIcon ic;
    public static ImageIcon ic2 = new ImageIcon("http://www-jkn.ee.uec.ac.jp/tnklab/96/nakazawa/icons/colorball/small /BALL120.gif");
    public static JLabel mapArea;
    //public static JApplet mapArea;
    //public static File output = new File("results.txt");
    public static boolean showPoint;
    public static int x;
    public static int y;
    private BufferedImage bufImg ;
    private Image smallImg ;
    int w;
    int h;
    /*public static BufferedImage bufImg ;
    public static Image smallImg ; */
    /* GeneralPath path;
    final int PAD = 20;
    final int N = 8; */
    public static MyJFrame f;
    public MyMapPanel() {}
    public MyMapPanel(ImageIcon ic)
    super(new FlowLayout (FlowLayout.CENTER, 0,0));
    textArea = new JTextArea();
    setImageIcon(ic);
    textArea.setEditable(false);
    JScrollPane scrollPane = new JScrollPane(textArea);
    add(scrollPane);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    scrollPane.setPreferredSize(new Dimension(700,100));
    //getContentPane().add(new MyPanel(), BorderLayout.CENTER);
    //addMouseListener( new MusClk() ) ;
    protected class MusClk extends MouseAdapter {
    public void mouseClicked ( MouseEvent musEvt ) {
    if( musEvt.getX() > bufImg.getWidth() || musEvt.getY() > bufImg.getHeight() ) {
    return ;
    Graphics g = bufImg.getGraphics() ;
    int w = smallImg.getWidth( null ) ;
    int h = smallImg.getHeight( null ) ;
    g.drawImage( smallImg , musEvt.getX() - w / 2 , musEvt.getY() - h / 2 , null ) ;
    MyMapPanel.this.repaint( musEvt.getX() - w / 2 , musEvt.getY() - h / 2 , w , h ) ;
    public ImageIcon getImageIcon()
    setImageIcon(ic);
    return ic;
    public void setImageIcon(ImageIcon ic)
    //MyPanel panel = new MyPanel();
    try{
    URL u = new URL(url);
    ic = new ImageIcon(u);
    } catch (MalformedURLException e) {
    System.out.println (e);
    mapArea = new JLabel(ic, JLabel.CENTER);
    add(mapArea);
    mapArea.addMouseListener(this);
    try {
    URL u = new URL(url);
    ic = new ImageIcon(u);
    } catch (MalformedURLException e){
    System.out.println(e);
    mapArea = new JApplet();
    add(mapArea);
    mapArea.addMouseListener(this); */
    /* public void setMouseEvent(MouseEvent e)
    x = e.getX();
    y = e.getY();
    showPoint = true;
    protected void paintComponent(Graphics g){ }
    public void dataTurbineOutputEvent(DataTurbineEvent event){}
    public void dataTurbineInputEvent(DataTurbineEvent event){}
    public void mouseReleased(MouseEvent e){}
    public void mousePressed(MouseEvent e) { }
    public void mouseEntered(MouseEvent e) {}
    public void mouseExited(MouseEvent e) { }
    public void mouseClicked(MouseEvent e)
    //setMouseEvent(e);
    //System.out.println("x="+x+" y="+y);
    showPoint = true;
    ImageIcon icon = new ImageIcon("C:/Documents and Settings/Nazli/My Documents/My Pictures/ball.gif");
    w = icon.getIconWidth();
    h = icon.getIconHeight();
    bufImg = new BufferedImage(w , h , BufferedImage.TYPE_INT_RGB ) ;
    Graphics g = bufImg.getGraphics();
    g.drawImage( icon.getImage() , 0 , 0 , null ) ;
    //MyMapPanel.this.repaint(e.getX() - w / 2 , e.getY() - h / 2 , w , h ) ;
    /*Point p = e.getPoint();
    Rectangle tag;
    final int SIDE = 6;
    tag = new Rectangle(0, 0, SIDE, SIDE);
    float x = e.getX();
    float y = e.getY();
    tag.setLocation(p.x - SIDE/2, p.y - SIDE/2);
    if(tag.contains(p.x,y))
    showPoint = true;
    setPoint(p);
    //System.out.println("e.getX="+e.getX()+""+"e.getY="+e.getY());
    saySomething("Position in pixels:(" + e.getX() + ", " + e.getY() + ")", e);
    String s1 = computeLatLong(e.getX());
    String s2 = computeLatLong(e.getY());
    saySomething("Position in Lat/Long: (" + s1 + ", " + s2 + ")", e);
    //g.drawImage(img, e.getX(), e.getY(), this);
    //DrawImage d = new DrawImage();
    //public void mouseClicked ( MouseEvent musEvt ) {
    //DrawImage d = new DrawImage();
    void saySomething(String eventDescription, MouseEvent e)
    textArea.append(eventDescription + " detected on " + e.getComponent().getClass().getName() + "." + newline);
    textArea.setCaretPosition(textArea.getDocument().getLength());
    public String computeLatLong(double d)
    double d1;
    double seconds;
    double minutes;
    double m;
    double s;
    String rval;
    d1 = d - Math.floor(d);
    seconds = d1 / 3600;
    minutes = seconds / 60;
    m = minutes - Math.floor(minutes);
    s = m * 60; //minutes converted to seconds
    rval = (int)Math.floor(d) + "deg " + (int)minutes + "' " + (int)s + '"';
    return rval;
    public MyJFrame getFrame()
    return f;
    public static void main(String[] args) throws IOException {
    //DrawImage d = new DrawImage();
    System.out.println("x="+x+" y="+y);
    ArrayList file = new ArrayList();
    File input = new File("lat_lon.txt");
    FileReader in = new FileReader(input);
    File output = new File("archive3.txt");
    FileWriter out = new FileWriter(output);
    //FileWriter in2 = new FileWriter(input);
    FileOutputStream outdata = new FileOutputStream(output);
    PrintStream p = new PrintStream(outdata);
    BufferedReader br = new BufferedReader(in, 4096);
    BufferedWriter bw = new BufferedWriter(new FileWriter("lat_lon.txt", true));
    String line; //each line in input file
    String s=null; //Main string containing points information, to be written to the output file
    while ((line = br.readLine()) != null )
    file.add(line);
    StringTokenizer st = new StringTokenizer(line,";");
    while(st.hasMoreTokens())
    s = st.nextToken();
    p.println(s);
    p.println("FINISHED DATA TRANSFER");
    p.println("\n");
    bw.write("DATA TRANSFERRED TO OUTPUT FILE");
    bw.newLine();
    bw.flush();
    p.close();
    //pops up the input dialogue window for the user to enter the image URL
    url = JOptionPane.showInputDialog(null,"Provide image URL:\n","Map Image", JOptionPane.PLAIN_MESSAGE);
    MyMapPanel panel = new MyMapPanel();
    if(url != null)
    panel.setImageIcon(ic);
    MyMapPanel mp = new MyMapPanel(ic);
    MyPanel panel2 = new MyPanel();
    //MyMapPanel mp2 = new MyMapPanel();
    JFrame jf = new JFrame();
    f = new MyJFrame(700,400);
    f.getContentPane().add(mp);
    //f.getContentPane().add(panel2);
    public static class MyJFrame extends JFrame {
    // Constructor.
    public MyJFrame (int width, int height)
    // Set the title and other frame parameters.
    this.setTitle ("GPS Map");
    this.setResizable (true);
    this.setSize (width, height);
    // Create and add the panel.
    MyMapPanel panel = new MyMapPanel();
    //MyPanel p = new MyPanel();
    //this.getContentPane().add (panel);
    this.getContentPane().add(panel);
    // Show the frame.
    this.setVisible (true);
    }

  • How do I get loops to keep the effect settings I hear when previewing?

    When I place loops into a new track, the effects settings go away and it is simply a dry signal. How can I move a loop from the browser into a new track and have it keep the effects settings that I hear when I preview the loop?

    If you drag a green MIDI loop onto the Arrange window space, it should create a Software instrument track with all the required plug-ins for the sound, so don't drag it to an already existing Software instrument track.
    If you drag it to an audio track it will convert it to an audio file, so obviously the instrument/fx plug-ins wont be in the channel strip.
    If that's what you mean?

  • 5. We need additional time to process your transaction You should get an email from us by next business day. If you don't hear back from us, you can check your order status on your account page or call us at +1 800-585-0774. If you're not in North America

    Step 5.
    5. We need additional time to process your transaction You should get an email from us by next business day. If you don't hear back from us, you can check your order status on your account page or call us at +1 800-585-0774. If you're not in North America, you can look up a local number here. For now, check out all the great free features of Creative Cloud! Get started with trials
    I keep getting this.
    The Bank and Paypal states that Adobe needs to process my transaction twice.
    I have no order number/ no status nor contact from Adobe. I called customer service and he transferred me to sales where the phone rang with no answer.

    Since this is an open forum, not Adobe support... you need to contact Adobe staff to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"
    -or by telephone http://helpx.adobe.com/x-productkb/global/phone-support-orders.html

  • I recieve SMS and i hear established melody and I do't hear the person on all over SMS. How to solve this problem?

    Problem with an incoming message. For example, during my conversation the second line receives a call, I hear the sound in dynamics such as "piiiip piiiip," but when in this situation I recieve SMS and i hear established melody and I do't hear the person on all over SMS. How to solve this problem? Perhaps someone tell me? save in advance

    Not Charge
    - See:     
    iPod touch: Hardware troubleshooting
    iPhone and iPod touch: Charging the battery
    - Try another cable. The cable for 5G iPod (lightning connector) seems to be more prone to failure than the older cable.
    - Try another charging source
    - Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
    - Make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar

  • I have a 2005 Jaguar xj8.  When I tried to upgrade my 3gs to a 4g I got a ticking noise in the speaker and no one on the other end could hear me.  I had to go back to a 3gs.  My phone is shot and I need to upgrade.  Has there been a fix to the problem?

    I have a 2005 Jaguar xj8.  When I tried to upgrade my 3gs to a 4g  two years ago, I got a ticking noise in the speaker and no one on the other end could hear me.  I had to go back to a 3gs.  My phone is shot and I need to upgrade.  Has there been a fix to the problem?  Apple told me there was some sort of interference with the airbag system.  Jaguar was totally unhelpful.

    Hi Labjock,
    Welcome to the Support Communities!
    The article below may be able to help you with this. 
    iPhone: Microphone issues
    http://support.apple.com/kb/ts5183
    Cheers,
    - Judy

  • Non-English character not showing up in JLabel correctly

    In my program there is a JLabel that displays Chinese characters in several sizes of fonts, it was displaying all of them correctly until my program grew larger and takes longer to initialize, now it is only displaying some sizes of fonts correctly while displaying others as rectangles. Since my program is too large to be imported here, I am trying to demo the problem in a smaller program, but in this smaller program, all sizes of fonts showed up correctly, here it is :
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class Java_Test extends JPanel
      static int Total=9000;
      JComboBox ComboBox_Array[]=new JComboBox[Total];
      Font Times_New_Roman_15_Font=new Font("Times New Roman",0,15);
      int Small_Chinese_Font_Size=3;
      String Software_Info_Chinese_Text="<Html><Table Width=100% Border=0 Cellpadding=2 Cellspacing=3><Tr><Td Align=Center><Font Size=6 Color=#3737FF>[ \u4EA7\u54C1\u7BA1\u7406 ] </Font></Td></Tr>"+
                                               "<Tr><Td Align=Center><Font Size=5 Color=green>\u5E2E\u52A9\u4F60\u7BA1\u7406\u4EA7\u54C1, \u5408\u540C, \u53CA\u5176\u5B83\u4FE1\u606F :</Font></Td></Tr>"+
                                               "<Tr><Td><Font Size="+Small_Chinese_Font_Size+" Color=#2255BB>"+
                                                 "<li>\u8F93\u5165, \u7EF4\u62A4\u548C\u6253\u5370\u8BE6\u7EC6\u4EA7\u54C1\u53CA\u4F9B\u8D27\u5546\u4FE1\u606F<Br>"+
                                                 "<li>\u5730\u5740\u548C\u5907\u6CE8\u4FE1\u606F\u53EF\u7528\u591A\u79CD\u8BED\u8A00\u8F93\u5165<Br>"+
                                               "</Font></Td></Tr>"+
                                               "</Table></Html>";
      Java_Test()
        for (int i=0;i<Total;i++) ComboBox_Array=new JComboBox();
    JLabel A_Non_English_Label=new JLabel(Software_Info_Chinese_Text);
    A_Non_English_Label.setFont(Times_New_Roman_15_Font);
    A_Non_English_Label.setForeground(Color.BLUE);
    add(A_Non_English_Label);
    setPreferredSize(new Dimension(500,200));
    static void Out(String message) { System.out.println(message); }
    public static void main(String[] args)
    final Java_Test demo=new Java_Test();
    Dimension Screen_Size=Toolkit.getDefaultToolkit().getScreenSize();
    final JFrame frame=new JFrame("Java Test");
    frame.add(demo);
    frame.addWindowListener(new WindowAdapter()
    public void windowClosing(WindowEvent e) { System.exit(0); }
    public void windowDeiconified(WindowEvent e) { demo.repaint(); }
    public void windowGainedFocus(WindowEvent e) { demo.repaint(); }
    public void windowOpening(WindowEvent e) { demo.repaint(); }
    public void windowResized(WindowEvent e) { demo.repaint(); }
    public void windowStateChanged(WindowEvent e) { demo.repaint(); }
    frame.pack();
    frame.setBounds((Screen_Size.width-demo.getWidth())/2,(Screen_Size.height-demo.getHeight())/2-10,demo.getWidth(),demo.getHeight()+38);
    frame.setVisible(true);
    As you can see, in this smaller program I'm trying to create a Total of 9000 objects to simulate lots of memory use, but to no avail. It is still displaying all sizes of fonts correctly.
    In my large program if I change html font from size 3 to size 5, it will display correctly, it seems that for certain sizes it can't display properly when the program gets too large and complicated, not because I don't have the fonts, but because of the complexity of my program. I wonder if anyone else has similar problems, and how to solve it ?
    Frank                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I've just made a breakthrough, the large program will work correctly if I comment out : A_Non_English_Label.setFont(Times_New_Roman_15_Font);
    But then the font doesn't look the way I wanted it to be.
    So I changed it to the following :
    ================================================
    Font Courier_New_15_Font=new Font("Courier New",0,15);
    A_Non_English_Label.setFont(Courier_New_15_Font);
    ================================================
    Now it looks not the same but similar to the way I wanted. Thus my question becomes : why it can't work correctly with "Times_New_Roman", but with "Courier_New" in the large program, they both displayed correctly in my small test program ? Is it because it takes too much resource to load the "Times_New_Roman" font ?
    Frank

  • Can not display ImageIcon in a JLabel where you want in the code ???

    Hello, everybody. I need your help to solve a problem I am on it for 2 days now :
    In the constructor of my class, I have a lot of initializing methods. If I try to display an image (with ImageIcon in a JLabel) within one of these methods, there is no problem and the image is correctely displayed. To try that, I use an image stored on my local disk in "c:\\".
    public class Bedes extends javax.swing.JFrame {
    public Bedes() {
    initComponents();
    -- further initializations
    initConnection();
    public void initConnection() {
    try {
    String driverName = "sun.jdbc.odbc.JdbcOdbcDriver";
    Properties systemProperties = System.getProperties();
    systemProperties.put("jdbc.drivers", driverName);
    System.setProperties(systemProperties);
    String dbURL = "jdbc:odbc:Bandes Dessin�es";
    String strUtilisateur = "bedes";
    String strMotDePasse = "cdle";
    connectBedes = DriverManager.getConnection(dbURL,strUtilisateur,strMotDePasse);
    catch (Exception e) {
    System.out.println("Exception in DB Contact " + e);
    // Here, I display an image in my JLabel, and it works :
    couvertureAlbumString = "c:\\myImage.jpg";
    couvertureAlbumsIcon = new ImageIcon(couvertureAlbumString);
    couvertureAlbumsJLabel.setIcon(couvertureAlbumsIcon);
    couvertureAlbumsJLabel.repaint();
    }The problem is that I do not want to display these images there, but in a method that read some data's in a Database (with "try"-"catch" blocks). If there is a name of an image store in the DB, then it must be displayed in the JLabel (located in a JFrame -> JDeskTopPane -> JTabbedPane -> JPanel).
    private void searchDetailsForAlbum(String albumsDetailsToSearch) {
    String nomImageCouverture;
    String couvertureAlbumString;
    ImageIcon couvertureAlbumsIcon;
    try {
    PreparedStatement requeteDetailsAlbums = connectBedes.prepareStatement("SELECT * FROM bandes_dess WHERE bede_nom_tome = ?");
    requeteDetailsAlbums.setString(1, albumsDetailsToSearch);
    ResultSet resultatDetailsAlbums = requeteDetailsAlbums.executeQuery();
    resultatDetailsAlbums.next();
    collectionAlbumsJTextField.setText(resultatDetailsAlbums.getString(6));
    genreAlbumsJTextField.setText(resultatDetailsAlbums.getString(9));
    dessinateurAlbumsJTextField.setText(resultatDetailsAlbums.getString(10));
    scenaristeAlbumsJTextField.setText(resultatDetailsAlbums.getString(11));
    coloristeAlbumsJTextField.setText(resultatDetailsAlbums.getString(12));
    prixAchatAlbumsJTextField.setText(resultatDetailsAlbums.getString(13));
    // Here is the name of the Image to de read
    nomImageCouverture = resultatDetailsAlbums.getString(14);
    catch (Exception e) {
    System.out.println("Exception in searchDetailsForAlbum" + e);
    couvertureAlbumString = "c:\\";
    // Here, I check if there is a name for a picture in the DB
    if (!(nomImageCouverture.equals("No"))) {
    // If Yes, I want to display it
    couvertureAlbumString = couvertureAlbumString + nomImageCouverture;
    couvertureAlbumsIcon = new ImageIcon(couvertureAlbumString);
    couvertureAlbumsJLabel.setIcon(couvertureAlbumsIcon);
    couvertureAlbumsJLabel.repaint();
    }My JLabel is well displayed, but empty, without any image on it. WHY ???
    MLK, you asked me to add some debug code. OK, with pleasure, but what is that "debug code" ???
    Thanks a lot in advance if you could help me.
    Christian.

    DEBUG: couvertureAlbumString: c:\Aldebaran-La-Photo
    OK, the extension of the file was NOT present !!!
    I added it and ..... it works pretty good !!!
    Thank you for your idea of the DEBUG.
    Christian.

  • Can't hear audio in trim mode.

    When I'm in trim mode and I play, in order to move the cut, I can't hear any audio.  It has nothing to do with scrubbing on/of because pressing shift+s has no effect.  It's also not working when I'm holding down "K" and pressing "L" simultaneously.
    DrL

    works for me.  Have you looked in the view menu to make sure audio scrubbing is checked?  It's possible you've reset the keyboard shortcut or your keyboard has somehow or other gotten corrupted.  You might try deleting your fcp preferences.  Use this:
    http://www.digitalrebellion.com/prefman/

  • TS3406 I am unable to hear caller on my Iphone 6 unless it is on speaker. any ideas on correcting the issue

    When making a call I cannot hear the other party unless I have my speaker on. Any idea on how to get phone to work without using the speaker to take private calls.

    Hello sirwin1999,
    For issues of not being able to hear from the receiver on your iPhone 6, then check out the article below. It will have you check the connections making sure that Bluetooth is not on as well as clearing out anything near the receiver itself. 
    If you can't hear a person on a call or voicemail or if the sound quality is poor on iPhone
    http://support.apple.com/kb/ts5196
    Regards,
    -Norm G. 

  • I am unable to hear anything on my iphone unless I have it on speaker.

    I am unable to hear my iphone at all unless I have the speaker on.  Has anyone experienced this before?  How did you resolve it?

    Try disconnecting the headphones and then adjusting the volume, does it say headphones?
    If it does, there might be something in the headphone jack, maybe lint, dirt, or something else in there.
    You can try getting it out by connecting the headphones 5-10x or spraying compressed air into the jack.
    If it doesn't say headphones or there isn't anything in there, try restarting or restoring the iPhone.

  • I am unable to hear anything on my iphone 4 nor can the person i call hear anything when i speak - I think that my ear piece and mike have both got magnetised how do fix the problem

    I am unable to hear anything on my iphone 4 nor can the person i call hear anything when i speak -
    I think that my ear piece and mike have both got magnetised how do fix the problem
    Please help

    I have the same problem!! It lead to many other problems with my phone
    I just arranged a repair with apple. Yes its inconvenient to be without a phone for a while but if your phone is in warranty its good to get it looked at professionally!

  • Unable to hear audio

    From both Microsoft Windows 2000 Advanced Server SP4 as well as Microsoft Windows XP Professional SP2, whenever some video or audio is played from the iTunes store (iTunes) or from the movie trailers (iTunes for H264 content or Quicktime) there is no audible sound. Went to the http://www.apple.com/quictime to manually check & install any updates to Quicktime v7.1 for Windows...there aren't any new updates and the same is true when automatically checking from the Quicktime player...there aren't any new updates. What am I to do as no sound is audible. This is from my Windows computer that I have with two separate drives each with their own windows MSW2KPro SP4 and MSWXPPro SP2. So there is not a problem there. What is there to do?

    Here is a change from my original post about not being able to hear sound from iTunes music store. As in the previous message regarding this post I am experiencing this problem with both Microsoft Windows 2000 Professional SP4 & Microsoft Windows XP Professional SP2. The problem occurs whenever the preview of a Television episode and Music video is previewed through iTunes Music Store, launching iTunes of course, no sound can be heard. To test whether this is an iTunes issue only or a sound card sound related issue, I played an uncompressed Divix movie & DVD movie on DVD-ROM disc in InterVideo's WinDVD, the Windows version of the free DivX player, RealPlayer v10.01 for Windows, Microsoft's Windows Media Player v10 and 11 BETA all playing fine with no issues related to sound. Sound is able to be heard clearly. I also have a Macintosh computer that has multiple HD connected running different versions of OSX "Panther" v10.2.8, "Jaguar" v10.3.9 & "Tiger" v10.4.6 which are able to successfully play the preview of different Television episodes and different Music videos. Please tell me what is happening here from the info given above.

  • JLabel components not being displayed on the content Panel in Applet

    Hi everyone!!
    Plz give a solution to the following problem:
    I have an applet in which i have JPanel component and on that component i am adding a lot of JLabel components but the problem is that the JLabel components are not displayed on the applet unless i minimize or maximize the applet.
    kindly give solution to the problem.
    Thanks

    Howdy,
    code would be helpful. Here is a very simple JApplet that displays labels okay here in appletviewer. You talk of applets and JLabels. I assume you are using JApplets.
    import javax.swing.*;
    import java.applet.*;
    import java.awt.*;
    public class AppletPie extends JApplet {
         public void init() {
              Container cp = getContentPane();
              cp.setLayout(new FlowLayout());
              cp.add(new JLabel("Show"));
              cp.add(new JLabel("up"));
              cp.add(new JLabel("you"));
              cp.add(new JLabel("dumb"));
              cp.add(new JLabel("labels"));
    }Perhaps something in this code will help you to solve your problem.
    regards
    sjl

  • IPhone 5S: does anybody has this problem. During a successful voice call all of a sudden people can't hear me while I can hear them

    iPhone 5S: does anybody has this problem. During a successful voice call all of a sudden people can't hear me while I can hear them. Signal is strong and call quality (me hearing the other) is still very good but it looks as if I’m going on mute while I’m not muting my iPhone. When dropping the call and re-dialing it works fine again. It’s a brand new iPhone 5S but it now happened already 4 or 5 times in 2 days.
    It feels like a hardware/iOS problem and not a network issue. It happend with iOS7.03 but I just see 7.0.4 is available so will install that one now.
    Thanks in advance for feedback
    Best regards,
    Marco

    Hello Jeff,
    Thank you for providing so much detail about the issue you are experiencing with the audio on your iPhone.  I would be concerned too if the audio on my iPhone was not working unless using speaker phone.  I found an article with some steps to take when you are experiencing issues like this:
    iPhone: Can't hear through the receiver or speaker
    http://support.apple.com/kb/TS1630
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

Maybe you are looking for