Swing link

Hi
How can i create a HTML Link in a label??
I would like that the standard browser open with this link.
I know that i can add a html text to the label. but how make i realise the action when i click at the link.

If you want a single link in the label just listen for a mouse event and do the linking yourself. Otherwise you could use a JEditorPane ( made to look like a label ) set up the page as html then and make use of addHyperlinkListener method.

Similar Messages

  • Why will my applet not run in a browser??

    Hi,
    I have recently converted a swing application to an applet for use on the web. The applet works perfectly when executed with appletviewer in the Command Prompt. However - when i open the html file - the browser tries to load the class but can't - the status bar at the bottom says "sample.class not found".
    My browser is capable of running other applets - and the class file does exist in the same folder.
    Can someone help with this??
    Thanks
    R

    If you have swing in your Java code then you need a
    java plug-in. To test if you have a Java plug-in
    installed go to:
    http://home.comcast.net/~millennm/amex.html
    Without the plug-in the AWT link works. But you need
    the plug-in for the Swing link to work.
    The plug-in is at:
    http://java.sun.com/j2se/1.3/download.html","Java_Runti
    e_Environment
    hi, excuse me...
    How can I write a plug-in needless Applet?
    After I browse the sample of the above article, I think that it seems if my Applet didn't use swing , it will not need to download a Java plug-in when it execute in a browser. But my Applet still need to download a plug-in, why?
    Here is my sample code:
    /* sample code start */
    import java.awt.*;
    import java.applet.*;
    public class test1 extends Applet
    public void paint(Graphics g)
    g.drawString("I'm Here!",160,80);
    /* sample code end */
    And here is my html code:
    <!-- html code start -->
    <applet code=test1.class width=320 height=100>
    </applet>
    <!-- html code end -->
    thank you very much.

  • How to display hourglass while ADF view link is retrieving rows in a swing.

    I posted this yesterday but did not get a solution, here is my posting again:
    Hi All,
    I have an ADF panel which includes several interdependent ADF View Objects and View Links. The query of the top view object might return several rows, then once user navigates from 1st to second row and so on, the dependent (child) view links display corresponding data. This is a swing app and not a web or jsf app.
    Sometimes it might take 8 to 12 seconds for the corresponding data from child view links to be retrieved, during this time window the ADF Panel might appear to be frozen to the user.
    So my question is what do I have to do so the ADF Panel would display hourglass while it is retrieving the rows for the corresponding child view links. If I have to manually update the java generated by Jdev, then what java line and where would I introduce it?
    Your inputs are most appreciated.
    Thanks.

    Check af:progressIndicator , af:statusIndicator
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/progressIndicator.html
    http://download.oracle.com/docs/cd/E15051_01/apirefs.1111/e12419/tagdoc/af_statusIndicator.html

  • Links to Swing articles and tutorials online

    Please share your best links to articles and tutorials
    online about GUI building in Java and Swing.
    yj

    Tutorial from Sun:
    http://java.sun.com/docs/books/tutorial/
    Articles on Swing:
    http://java.sun.com/products/jfc/tsc/articles/index.html

  • How to link crystal report with swing

    I am developing applications in swing. I have done a report using crystal report.
    Now i don't know how to link it with swing. can anyone help me to solve this with some examles.
    thanx in advanz

    Hope these links are useful:
    http://www.must.de/default.html?Jareport.htm
    http://www.utdallas.edu/~pxm034000/files/integrating.html

  • How to activivate a URL link in swing programme?

    I'm new to Swing. Just wondering, is there anyway to print a url link in swing, like "http://www.hotmail.com", then be able to get the html page of that link? thanks!

    Hi,
    have a look at javax.swing.JEditorPane
    greetings Marsian

  • Linking a Java class to a Swing GUI...

    Well I've got a class for running a text based interface for a simple queue system. All I need to do is link it to the GUI i have designed. Below is the code for both. Anyone that can give me code to link the classes between them (I'm going to change the uuInOut statements to .getText() where relevant).
    Thanks for the help. My bloodpressure and stress levels need it.
    import uuInOut;
    class Queue
         QueueNode start;
         QueueNode end;
         public int totalSize = 0;
         public int choice;
         public String yesNo;
         public Queue()
                        start = new QueueNode();
                        start = null;
                        end = new QueueNode();
                        end = null;
         public void add()
              if (start==null)
                   start = new QueueNode();
                   System.out.print("\nPlease enter your username: ");
                   start.owner = uuInOut.ReadString();
                   System.out.print("\nPlease enter the name of the document:");
                   start.name = uuInOut.ReadString();
                   System.out.print("\nPlease enter the size of the document(in kilbytes):");
                   start.size = uuInOut.ReadInt();     
                   totalSize = totalSize + start.size;
                   start.next = null;
                   start.previous = null;
                   end = start;
              else
                   QueueNode temp = new QueueNode();
                   System.out.print("\nPlease enter your username: ");
                   temp.owner = uuInOut.ReadString();
                   System.out.print("\nPlease enter the name of the document:");
                   temp.name = uuInOut.ReadString();
                   System.out.print("\nPlease enter the size of the document(in kilobytes):");
                   temp.size = uuInOut.ReadInt();     
                   totalSize = totalSize + temp.size;
                   temp.next = end;
                   end.previous = temp;
                   end = temp;
         public boolean isEmpty()
              return (start==null);
         public void remove()
              String name2;
              QueueNode before = new QueueNode();
              QueueNode after = new QueueNode();
              QueueNode temp = new QueueNode();
              if (this.isEmpty())
                        System.out.println("Error there are no documents in the queue.");
                   else
                        do
                             System.out.println("Which document do you wish to remove: ");
                             name2 = uuInOut.ReadString();
                             while(temp.name!=name2)
                                  before = temp.previous;
                                  after = temp.next;
                                  temp.next = after;
                                  temp.previous = before;
                                  temp = before;
                                  System.out.println("\nThe document has been removed");
                        System.out.print("\nDo you wish to remove another document: ");
                        yesNo = uuInOut.ReadString();
                        }while(this.yesNo.equalsIgnoreCase("y"));
         public void displayAll()
              if (this.isEmpty())
                   System.out.println("\nThere are no documents to display.");
              else
                   System.out.println("User\t\tDoc Name\t\tSize\n");
                   QueueNode temp = new QueueNode();
                   temp = start;
                   while (temp!=null)
                        System.out.println(temp.owner+"\t\t"+temp.name+"\t\t\t"+temp.size);
                        temp = temp.previous;          
         public int getSize()
              return totalSize;
         public void purge()
              if (this.isEmpty())
                   System.out.println("\nThere are no documents in the queue.");
              else
                   start = new QueueNode();
                   start = null;
                   end = new QueueNode();
                   end = null;
                   totalSize = 0;
                   System.out.println("The queue is now empty.");
         public void displayMenu()
              System.out.println("\n\t\tMain Menu");
              System.out.println("\n\t1.\tAdd a document to the Queue");
              System.out.println("\t2.\tRemove a document from the Queue");
              System.out.println("\t3.\tDisplay all documents in the Queue");
              System.out.println("\t4.\tDisplay the total size of the Queue");
              System.out.println("\t5.\tPrint a document");
              System.out.println("\t6.\tPurge all documents from the Queue");
              System.out.println("\n\t8.\tExit Program");
              System.out.flush();
         public void print(String name2)
              if(this.isEmpty())
                   System.out.println("\nThere are no documents to print.");
              else
                   System.out.println("Printed");
    Here's the code for the GUI (there seems to be a problem with it which I cant seem to figure out)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import Queue.*;
    import QueueNode;
    public class PrinterQueueInterface extends JFrame implements ActionListener
         JLabel nameLabel, userLabel, sizeLabel, numberLabel, totalLabel;
         JTextField nameBox, userBox, sizeBox, numberBox, totalBox;
         JButton addButton, removeButton, printButton, purgeButton, exitButton;
         public PrinterQueueInterface()
              super("Queue System");
              setSize(350,360);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              nameLabel = new JLabel("Name:");
              userLabel = new JLabel("User:");
              sizeLabel = new JLabel("Size:");
              numberLabel = new JLabel("No. Of Items in Queue:");
              totalLabel = new JLabel("Total Size of the Queue:");
              nameBox = new JTextField(15);
              userBox = new JTextField(15);
              sizeBox = new JTextField(5);
              numberBox = new JTextField(3);
              totalBox = new JTextField(15);
              addButton = new JButton("Add Document");
              removeButton = new JButton("Remove Document");
              printButton = new JButton("Print Document");
              purgeButton = new JButton("Purge the Queue");
              exitButton = new JButton("Exit");
              JPanel pane = new JPanel();
              setContentPane(pane);
              show();
              Container contentPane = getContentPane();
              contentPane.setLayout(new GridLayout(0,2));
              setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
              contentPane.add(nameLabel);
              contentPane.add(nameBox);          
              contentPane.add(userLabel);
              contentPane.add(userBox);
              contentPane.add(sizeLabel);
              contentPane.add(sizeBox);
              contentPane.add(numberLabel);
              contentPane.add(numberBox);
              contentPane.add(totalLabel);
              contentPane.add(totalBox);
              setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
              contentPane.add(addButton);
              contentPane.add(removeButton);
              contentPane.add(printButton);
              contentPane.add(purgeButton);
              contentPane.add(exitButton);
              addButton.setLocation(50,100);
              removeButton.setLocation(10, 100);
              printButton.setLocation(20,100);
              purgeButton.setLocation(30,100);
              exitButton.setLocation(40,100);
              addButton.addActionListener(this);
              removeButton.addActionListener(this);
              printButton.addActionListener(this);
              purgeButton.addActionListener(this);
              exitButton.addActionListener(this);
              public void actionPerformed(ActionEvent evt)
                   Object source = evt.getSource();
                   if (source==exitButton)
                        System.exit(0);
                   else if (source==clearButton)
                        nameBox.setText("");
                        userBox.setText("");
                   else
                        public String docName = nameBox.getText();
                        public String userName = userBox.getText();
                        public String docSize = sizeBox.getText.toInt();
                        if (source==addButton)
                             Queue.add(docName, userName, docSize);
                        else if (source==removeButton)
                             Queue.remove(docName, userName, docSize);
                        else if (source==printButton)
                             Queue.print();
                        else if (source==purgeButton)
                             Queue.purge();
              public void main(String[] args)
                   new PrinterQueueInterface();
    }

    It is simple and very annoying.
    I think you should try to do it yourself to learn how Java works, it is a good exercise for you.
    The forum is used to work together on different problems, giving tips and ideas but not coding for other people.
    About your problem, two things : you should rewrite all the code (not trying to link these two classes) and you will have serious problems wityh the different setLayout you use !
    Denis

  • Swing Applets && HTML links

    Hi Sun Team and Swing Fans!
    I am trying to embed Hypertext Markup Language in my Swing applet..or sould I say..I am trying to add an HTML link in my Swing applet...
    The body looks something like that:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class images extends JApplet implements ActionListener {
    bla bla bla .... My program
    Is there a way to do that and if there is, how do I implement it?
    Thank you very much in advance, Albert.

    Howdy,
    If you just want a simple link on your page you could either draw you link on the page and then when mouse down get the coords to see if over your link then:
    try {newURL = new URL("http://www.counter-strike.net");}
                   catch (MalformedURLException e1){}
                   getAppletContext().showDocument(newURL);
    for example. Or you could embed a JEditorPane with HyperlinkListener, in that case you will need to import Javax.swing.event (I think).

  • Linking Swing classes

    I need the link the two classes I have pasted below. Please examine the code, I have created a new object of the type, the second class, but it doesnt execute when the option dialog is pressed, please advise on how i can get it to work... but classes are error free and work. Help would be much appreciated
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MainMenu extends JFrame implements ActionListener {
    JButton exRwButton;
    JButton exQsButton;
    JButton dspExButton;
    JButton exitButton;
    JButton exInButton;
    JLabel MainMenuLabel;
    JFrame frame;
    public MainMenu() {
    MainMenuLayout customLayout = new MainMenuLayout();
    getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
    getContentPane().setLayout(customLayout);
    exRwButton = new JButton("Excercise Review");
    getContentPane().add(exRwButton);
              exRwButton.addActionListener(this);
              exQsButton = new JButton("Excercise Questionaire");
    getContentPane().add(exQsButton);
    exQsButton.addActionListener(this);
              dspExButton = new JButton("Display Current Excercise Plan");
    getContentPane().add(dspExButton);
    dspExButton.addActionListener(this);
    exitButton = new JButton("Exit Excercise Asistant");
    getContentPane().add(exitButton);
    exitButton.addActionListener(this);
    exInButton = new JButton("Initial Questionaire");
    getContentPane().add(exInButton);
              exInButton.addActionListener(this);
              MainMenuLabel = new JLabel("Excercise Asistant Main Menu");
    getContentPane().add(MainMenuLabel);
    setSize(getPreferredSize());
    public static void main(String args[]) {
    MainMenu window = new MainMenu();
    window.setTitle("MainMenu");
    window.pack();
    window.show();
    public void actionPerformed(ActionEvent e)
         MainMenu frame = new MainMenu();
         //dispose();
         Object source = e.getSource();
         if(source instanceof JButton)
              if(source == exRwButton)
                   Object[] options1 = {"Yes", "Cancel"};
    JOptionPane.showOptionDialog(
    frame, "Would you like to perform an Excercise Plan Review?",
    "Confirm Selection",
    JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options1, options1[0]);
              else if (source == exQsButton)
                   Object[] options2 = {"Yes", "Cancel"};
    JOptionPane.showOptionDialog(frame, "Would you like to perform an Excercise Plan Questionaire?",
    "Confirm Selection",
    JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options2, options2[0]);
              else if(source == exInButton)
                   Object[] options3 = {"Yes", "Cancel"};
    JOptionPane.showOptionDialog(
    frame, "Would you like to perform an Intial Personal Questionaire?",
    "Confirm Selection",
    JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options3, options3[0]);
    Menu1 me = new Menu1(); // i have added this statement to open the next java file with
                                                 //the class name Menu1, but it doesnt seam to work
              else if(source == dspExButton)
                   Object[] options4 = {"Yes", "Cancel"};
    JOptionPane.showOptionDialog(
    frame, "Would you like to display your current Excecise Plan?",
    "Confirm Selection",
    JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options4, options4[0]);
              else if(source == exitButton)
                   Object[] options5 = {"Yes", "Cancel"};
    JOptionPane.showOptionDialog(
    frame, "Are you sure you want to exit the excercise assistant?",
    "Confirm Selection",
    JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options5, options5[0]);
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    class MainMenuLayout implements LayoutManager {
    public MainMenuLayout() {
    public void addLayoutComponent(String name, Component comp) {
    public void removeLayoutComponent(Component comp) {
    public Dimension preferredLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    Insets insets = parent.getInsets();
    dim.width = 510 + insets.left + insets.right;
    dim.height = 242 + insets.top + insets.bottom;
    return dim;
    public Dimension minimumLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    return dim;
    public void layoutContainer(Container parent) {
    Insets insets = parent.getInsets();
    Component c;
    c = parent.getComponent(0);
    if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+72,240,24);}
    c = parent.getComponent(1);
    if (c.isVisible()) {c.setBounds(insets.left+264,insets.top+72,240,24);}
    c = parent.getComponent(2);
    if (c.isVisible()) {c.setBounds(insets.left+264,insets.top+112,240,24);}
    c = parent.getComponent(3);
    if (c.isVisible()) {c.setBounds(insets.left+168,insets.top+160,184,24);}
    c = parent.getComponent(4);
    if (c.isVisible()) {c.setBounds(insets.left+8,insets.top+112,240,24);}
    c = parent.getComponent(5);
    if (c.isVisible()) {c.setBounds(insets.left+152,insets.top+24,208,24);}
    //class which precious code should connect to i.e. open when selection is made from option dialog
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Menu1 extends JFrame {
    JLabel genderLabel;
    JLabel titleLabel;
    JLabel iniQLabel;
    JLabel ageLabel;
    JComboBox ageCombobox;
    ButtonGroup cbg;
    JRadioButton radio_1;
    JRadioButton radio_2;
    JLabel weightLabel;
    JComboBox weightCombobox;
    JLabel heightLabel;
    JComboBox heightCombobox2;
    JComboBox heightCombobox1;
    JLabel q1Label;
    JComboBox q1Combobox;
    JLabel q2Label;
    JComboBox q2Combobox;
    JLabel q3Label;
    JComboBox q3Combobox;
    JLabel q1Label2;
    JLabel q4Label;
    JComboBox q4Combobox;
    JLabel q4Label2;
    JLabel q5Label;
    JComboBox q5Combobox;
    JButton submitButton;
    JLabel decisionLabel;
    JLabel label_2;
    JLabel decisionLabel2;
    public Menu1() {
    Menu1Layout customLayout = new Menu1Layout();
    getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
    getContentPane().setLayout(customLayout);
    genderLabel = new JLabel("Gender");
    getContentPane().add(genderLabel);
    titleLabel = new JLabel("Please answer the following questions:");
    getContentPane().add(titleLabel);
    iniQLabel = new JLabel("Personal Questions");
    getContentPane().add(iniQLabel);
    ageLabel = new JLabel("Age Range");
    getContentPane().add(ageLabel);
    ageCombobox = new JComboBox();
    ageCombobox.addItem("Select");
    ageCombobox.addItem("16 - 20");
    ageCombobox.addItem("20 - 25");
    ageCombobox.addItem("25 - 30");
    ageCombobox.addItem("30 - 40");
    ageCombobox.addItem("40 - 50");
    ageCombobox.addItem("50+");
    getContentPane().add(ageCombobox);
    cbg = new ButtonGroup();
    radio_1 = new JRadioButton("Male", false);
    cbg.add(radio_1);
    getContentPane().add(radio_1);
    radio_2 = new JRadioButton("Female", false);
    cbg.add(radio_2);
    getContentPane().add(radio_2);
    weightLabel = new JLabel("Weight Range");
    getContentPane().add(weightLabel);
    weightCombobox = new JComboBox();
    weightCombobox.addItem("Select");
    weightCombobox.addItem("40 - 50");
    weightCombobox.addItem("50 - 60");
    weightCombobox.addItem("60 - 70");
    weightCombobox.addItem("70 - 80");
    weightCombobox.addItem("80 - 90");
    weightCombobox.addItem("90 - 120");
    weightCombobox.addItem("120+");
    getContentPane().add(weightCombobox);
    heightLabel = new JLabel("Height Range");
    getContentPane().add(heightLabel);
    heightCombobox2 = new JComboBox();
    heightCombobox2.addItem("cm");
    heightCombobox2.addItem("10");
    heightCombobox2.addItem("20");
    heightCombobox2.addItem("30");
    heightCombobox2.addItem("40");
    heightCombobox2.addItem("50");
    heightCombobox2.addItem("60");
    heightCombobox2.addItem("70");
    heightCombobox2.addItem("80");
    heightCombobox2.addItem("90");
    getContentPane().add(heightCombobox2);
    heightCombobox1 = new JComboBox();
    heightCombobox1.addItem("Metres");
    heightCombobox1.addItem("0");
    heightCombobox1.addItem("1");
    heightCombobox1.addItem("2");
    getContentPane().add(heightCombobox1);
    q1Label = new JLabel("How many hours a week would would you like to excercise?");
    getContentPane().add(q1Label);
    q1Combobox = new JComboBox();
    q1Combobox.addItem("Hours");
    q1Combobox.addItem("1");
    q1Combobox.addItem("2");
    q1Combobox.addItem("3");
    q1Combobox.addItem("4");
    q1Combobox.addItem("5");
    q1Combobox.addItem("10");
    q1Combobox.addItem("15");
    q1Combobox.addItem("20");
    getContentPane().add(q1Combobox);
    q2Label = new JLabel("What kind of excercise would suit you best?");
    getContentPane().add(q2Label);
    q2Combobox = new JComboBox();
    q2Combobox.addItem("Excercise Type");
    q2Combobox.addItem("Sports Activity");
    q2Combobox.addItem("Group Sports");
    q2Combobox.addItem("Aerobic");
    q2Combobox.addItem("Anaerobic");
    getContentPane().add(q2Combobox);
    q3Label = new JLabel("if your choose \"Aerobic\" please specify type.");
    getContentPane().add(q3Label);
    q3Combobox = new JComboBox();
    q3Combobox.addItem("Aerobic Types");
    q3Combobox.addItem("Running");
    q3Combobox.addItem("Circuit Training");
    q3Combobox.addItem("Swimming");
    q3Combobox.addItem("Stair Climbing");
    getContentPane().add(q3Combobox);
    q1Label2 = new JLabel("(Active hours per week for adult human is 60hrs approx)");
    getContentPane().add(q1Label2);
    q4Label = new JLabel("If you chose \"Anaerobic\" please specify type.");
    getContentPane().add(q4Label);
    q4Combobox = new JComboBox();
    q4Combobox.addItem("Anerobic Type");
    q4Combobox.addItem("Free Weights");
    q4Combobox.addItem("General Weight Training");
    q4Combobox.addItem("General Resistance");
    getContentPane().add(q4Combobox);
    q4Label2 = new JLabel("Note. Genral Resistance is for people whom have access to gym equipment");
    getContentPane().add(q4Label2);
    q5Label = new JLabel("What is the main Purpose of your Excercise Plan, What is your main excercise focus, ");
    getContentPane().add(q5Label);
    q5Combobox = new JComboBox();
    q5Combobox.addItem("Goals");
    q5Combobox.addItem("Muscle Gain");
    q5Combobox.addItem("Fat Loss");
    q5Combobox.addItem("Weight Loss");
    q5Combobox.addItem("Increased Fitness");
    getContentPane().add(q5Combobox);
    submitButton = new JButton("Submit");
    getContentPane().add(submitButton);
    decisionLabel = new JLabel("When you have filled out questionaire press submit button to go back to the main");
    getContentPane().add(decisionLabel);
    label_2 = new JLabel("please select most appropriate option.");
    getContentPane().add(label_2);
    decisionLabel2 = new JLabel("menu where you can select the Excercise Questionsaire");
    getContentPane().add(decisionLabel2);
    setSize(getPreferredSize());
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    public static void main(String args[]) {
    Menu1 window = new Menu1();
    window.setTitle("Menu1");
    window.pack();
    window.show();
    class Menu1Layout implements LayoutManager {
    public Menu1Layout() {
    public void addLayoutComponent(String name, Component comp) {
    public void removeLayoutComponent(Component comp) {
    public Dimension preferredLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    Insets insets = parent.getInsets();
    dim.width = 594 + insets.left + insets.right;
    dim.height = 593 + insets.top + insets.bottom;
    return dim;
    public Dimension minimumLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    return dim;
    public void layoutContainer(Container parent) {
    Insets insets = parent.getInsets();
    Component c;
    c = parent.getComponent(0);
    if (c.isVisible()) {c.setBounds(insets.left+256,insets.top+72,64,16);}
    c = parent.getComponent(1);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+16,272,16);}
    c = parent.getComponent(2);
    if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+48,120,16);}
    c = parent.getComponent(3);
    if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+72,96,16);}
    c = parent.getComponent(4);
    if (c.isVisible()) {c.setBounds(insets.left+128,insets.top+72,88,24);}
    c = parent.getComponent(5);
    if (c.isVisible()) {c.setBounds(insets.left+256,insets.top+88,88,16);}
    c = parent.getComponent(6);
    if (c.isVisible()) {c.setBounds(insets.left+256,insets.top+104,88,16);}
    c = parent.getComponent(7);
    if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+128,96,16);}
    c = parent.getComponent(8);
    if (c.isVisible()) {c.setBounds(insets.left+128,insets.top+128,88,24);}
    c = parent.getComponent(9);
    if (c.isVisible()) {c.setBounds(insets.left+256,insets.top+128,80,16);}
    c = parent.getComponent(10);
    if (c.isVisible()) {c.setBounds(insets.left+432,insets.top+128,72,24);}
    c = parent.getComponent(11);
    if (c.isVisible()) {c.setBounds(insets.left+360,insets.top+128,72,24);}
    c = parent.getComponent(12);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+168,512,16);}
    c = parent.getComponent(13);
    if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+184,120,24);}
    c = parent.getComponent(14);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+216,512,16);}
    c = parent.getComponent(15);
    if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+232,168,24);}
    c = parent.getComponent(16);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+264,512,16);}
    c = parent.getComponent(17);
    if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+280,168,24);}
    c = parent.getComponent(18);
    if (c.isVisible()) {c.setBounds(insets.left+160,insets.top+184,376,16);}
    c = parent.getComponent(19);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+320,512,16);}
    c = parent.getComponent(20);
    if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+360,128,24);}
    c = parent.getComponent(21);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+336,512,16);}
    c = parent.getComponent(22);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+408,512,16);}
    c = parent.getComponent(23);
    if (c.isVisible()) {c.setBounds(insets.left+32,insets.top+456,176,24);}
    c = parent.getComponent(24);
    if (c.isVisible()) {c.setBounds(insets.left+208,insets.top+552,104,24);}
    c = parent.getComponent(25);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+504,512,16);}
    c = parent.getComponent(26);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+424,512,16);}
    c = parent.getComponent(27);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+520,512,16);}

    Compare the code in your listenerMenu1 me = new Menu1(); // i have added this statement to open the next java file with
    //the class name Menu1, but it doesnt seam to workwith the code in the main method of Menu1Menu1 window = new Menu1();
    window.setTitle("Menu1");
    window.pack();
    window.show();See anything missing above?

  • Swings-JEditorPane-email link

    i am having an e-mail link in html file which i am getting from the system and displaying in JEditorPane. The problem is, on clicking the link it is not opening the outlook express new mail box though it is opening it when run independent of JEditorPane. It is throwing exceptions,Can any one of u help me out Please?

    My guess is that this functionality is not part of the JEditorPane/HMTLEditorKit/HTMLDocument classes. To implement this, grab the URL from the hyperlink event (evt.getURL())and check to see if it is a mailto URL. If it is, then use a system call to open Outlook with the recipient in the To: field.
    Hope this helps...

  • Link in swing

    hi guys!
    i want to provide a link in gui,Jinternal frame, which opens up a browser with target provided by the link, so which component is used for this.
    Also is it possible that applet have multiple frames in it and menus also.
    Thanks.

    Look at JEditorPane and adding a HyperTextListener
    Cheers
    DB

  • Open plain ole web page from a swing component link?

    Can you create a regular hyper link like in html, and have a onclick or something like that, and have it open into a regular webpage. Not a JPanel, or anything like that, just a plain IE, Mozilla, etc... webpage.
    something simple www.yahoo.com?

    Linux (only tested on Ubuntu 7.04 and 7.10)
                                if (OS.equals("Linux")) {
                                    Runtime rt = Runtime.getRuntime();
                                    String[] args = new String[]{"sh", "-c", browserpath + " " + siteaddress};
                                    rt.exec(args);
                                }Where path to executing app, in this case firefox, is provided.
    I.e 'browserpath' is for example '/user/bin/firefox'

  • Link to the post in swing forum page

    http://forum.java.sun.com/thread.jspa?threadID=5175990&tstart=0
    please help

    You got the answer in that other post.

  • How to give Common Background color for all JPanels in My Swing application

    Hi All,
    I am developing a swing application using The Swing Application Framework(SAF)(JSR 296). I this application i have multiple JPanel's embedded in a JTabbedPane. In this way i have three JTabbedPane embedded in a JFrame.
    Now is there any way to set a common background color for the all the JPanel's available in the application??
    I have tried using UIManager.put("Panel.background",new Color.PINK);. But it did not work.
    Also let me know if SAF has some inbuilt method or way to do this.
    Your inputs are valuable.
    Thanks in Advance,
    Nishanth.C

    It is not the fault of NetBeans' GUI builder, JPanels are opaque by default, I mean whether you use Netbeans or not.Thank you!
    I stand corrected (which is short for +"I jumped red-eyed on my feet and rushed to create an SSCCE to demonstrate that JPanels are... mmm... oh well, they are opaque by default... ;-[]"+)
    NetBeans's definitely innocent then, and indeed using it would be an advantage (ctrl-click all JPanels in a form and edit the common opaque property to false) over manually coding
    To handle this it would be better idea to make a subclass of JPanel and override isOpaque() to return false. Then use this 'Trasparent Panel' for all the panels where ever transparency is required.I beg to differ. From a design standpoint, I'd find it terrible (in the pejorative sense of the word) to design a subclass to inconsistently override a getter whereas the standard API already exposes the property (both get and set) for what it's meant: specify whether the panel is opaque.
    Leveraging this subclass would mean changing all lines where a would-be-transparent JPanel is currently instantiated, and instantiate the subclass instead.
    If you're editing all such lines anyway, you might as well change the explicit new JPanel() for a call to a factory method createTransparentJPanel(); this latter could, at the programmer's discretion, implement transparency whichever way makes the programmer's life easier (subclass if he pleases, although that makes me shudder, or simply call thePanel.setOpaque(false) before returning the panel). That way the "transparency" code is centralized in a single easy to maintain location.
    I had to read the code for that latter's UI classes to find out the keys to use (+Panel.background+, Label.foreground, etc.), as I happened to not find this info in an authoritative document - I see that you seem to know thoses keys, may I ask you where you got them from?
    One of best utilities I got from this forum, written by camickr makes getting these keys and their values very easy. You can get it from his blog [(->link)|http://tips4java.wordpress.com/2008/10/09/uimanager-defaults/]
    Definitely. I bit a pair of knucles off when discovered it monthes after cumbersomely traversing the BasicL&F code...
    Still, it is a matter-of-fact approach (and this time I don't mean that to sound pejorative), that works if you can test the result for a given JDK version and L&F, but doesn't guarantee that these keys are there to stand - an observation, but not a specification.
    Thanks TBM for highlighting this blog entry, that's the best keys list device I have found so far, but the questions still holds as to what specifies the keys.
    Edited by: jduprez on Feb 15, 2010 10:07 AM

  • I want to implement thems functionality in  my swing application

    Hi All...
    I want to implement the themes object in my swing application,How ,where to start and move that functionality,If anybody use this functionality in your program experience can u share with me.
    Than to Advance
    ARjun...

    Hi Kuldeep Chitrakar
    I can do that in web intelligence. dont want that
    I am replicating some of the sample report of SQL Servers in BusinessObjects XI R3.1.
    One of the SQL Sever's report is of product catalogue type that gives complete information like name, category, description along with the products image etc... for each of the products.
    I am trying to replicate the above said SQL Server report in Business objects XI R3.1. I am facing problem in bringing the image in to my BO report. The image resides in a table and its datatype is of varbinary(max). I don't know the exact matching while creating an object in the uiverse designer.
    Here is the url link http://errorsbusinessobjectsxir3.blogspot.com/2010/10/business-objects-image-errors.html
    Regards
    Prasad

Maybe you are looking for