private void getPin(final String authURL) {

        //Form components
        JEditorPane authText;
        JButton submitButton;

        //Create a JFrame
        pinForm = new JFrame();
        pinForm.setSize(400, 260);
        pinForm.setLayout(new BorderLayout(5, 10));

        //Use HTML to tell the user what the form is all about
        String aText = "<center>"
                + "<h1>You must authenticate with Twitter</h1>"
                + "<p>Copy the PIN given to you from the Twitter Website and enter it below.</p>"
                + "<p>If the Twitter page doesn't open automatically <a href=\"" + authURL + "\">follow this link</a>."
                + "</center>";
        authText = new JEditorPane(new HTMLEditorKit().getContentType(), aText);
        Font font = UIManager.getFont("Label.font");
        String bodyRule = "body { font-family: " + font.getFamily() + "; "
                + "font-size: " + font.getSize() + "pt; }";
        ((HTMLDocument) authText.getDocument()).getStyleSheet().addRule(bodyRule);
        authText.addHyperlinkListener(
                new HyperlinkListener() {
                    // if user clicked hyperlink, go to specified page

                    public void hyperlinkUpdate(HyperlinkEvent event) {
                        if (event.getEventType()
                                == HyperlinkEvent.EventType.ACTIVATED) {
                            try {
                                new OpenURL(authURL);
                            } catch (Exception ex) {
                                JOptionPane.showMessageDialog(new JFrame(), ex.getMessage(), "Error",
                                        JOptionPane.ERROR_MESSAGE);
                                System.exit(1);
                            }
                        }
                    } // end method hyperlinkUpdate
                } // end inner class
                );
        authText.setContentType("text/html");
        authText.setEditable(false);
        authText.setText(aText);

        //Set up the input field
        final JTextField pinEntry = new JTextField();
        pinEntry.addActionListener(
                new ActionListener() {

                    //close the pin window and set the pin
                    public void actionPerformed(ActionEvent event) {
                        setPin(pinEntry.getText());
                        pinForm.setVisible(false);

                    }
                });

        //Set up a submit button
        submitButton = new JButton();
        submitButton.setText("Authenticate");
        submitButton.addActionListener(new ActionListener() {

            //close the pin window and set the pin
            public void actionPerformed(ActionEvent event) {
                setPin(pinEntry.getText());
                pinForm.setVisible(false);
            }
        });

        //add components to the form and set visible
        pinForm.add(authText, BorderLayout.NORTH);
        pinForm.add(pinEntry, BorderLayout.CENTER);
        pinForm.add(submitButton, BorderLayout.SOUTH);
        pinForm.setVisible(true);

    }