Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>public class SSBTest extends javax.swing.JFrame { /** Creates new form worker1 */ public SSBTest() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // &lt;editor-fold defaultstate="collapsed" desc="Generated Code"&gt; private void initComponents() { jLabel1 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel1.setText("jLabel1"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 348, Short.MAX_VALUE)); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 210, Short.MAX_VALUE)); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap(196, Short.MAX_VALUE).addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE).addGap(178, 178, 178)).addGroup(layout.createSequentialGroup().addGap(86, 86, 86).addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addContainerGap(122, Short.MAX_VALUE))); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 40, Short.MAX_VALUE).addComponent(jLabel1).addGap(36, 36, 36))); pack(); }// &lt;/editor-fold&gt; /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { final SSBTest ssbTest = new SSBTest(); ssbTest.setVisible(true); ssbTest.execute(); } }); } private void execute() { (new MeaningOfLifeFinder(jLabel1, jPanel1)).execute(); } // Variables declaration - do not modify private javax.swing.JLabel jLabel1; private javax.swing.JPanel jPanel1; // End of variables declaration } class MeaningOfLifeFinder extends SwingWorker&lt;Icon, Object&gt; { JLabel label = null; JPanel panel; MeaningOfLifeFinder(JLabel label, JPanel jpanel) { this.label = label; this.panel = jpanel; } protected Icon doInBackground() throws IOException { URL imageurl; Image image = null; System.out.println("image loading"); imageurl = new URL("http://maps.google.com/maps/api/staticmap" + "?zoom=14&amp;size=512x512&amp;maptype=roadmap" + "&amp;markers=color:green|label:21|-15.0,-150.0&amp;sensor=false"); //image = (Toolkit.getDefaultToolkit().createImage(imageurl)); image = ImageIO.read(imageurl); ImageIcon icon = new ImageIcon(image); System.out.println("image loaded..."); return icon; } @Override protected void done() { try { System.out.println("image adding to label..."); label.setIcon(get()); //panel.add(label); System.out.println("image loaded to label..."); } catch (Exception ignore) { } } // System.out.println(panel.getSize().width); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload