Search Results

Search found 3339 results on 134 pages for 'swing magic'.

Page 3/134 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Swing data binding frameworks

    - by Ahe
    Hi Almost the same question has been asked a year ago, but the there has been some new development in this area. Selecting a (data binding) framework for swing application seems to be quite difficult. JSR-295 is abandoned, many swing frameworks which provide binding are work-in-progress, abandoned or too heavy for my quite simple app. JGoodies Swing suite is expensive, but luckily its libraries are free. Has anyone any real-world experience of new UFaceKit. It looks promising, but quite immature. I am particularly interested in Swing implementation and documentation. Any insight on UFaceKits development schedule would be appreciated, because I can hold by framework choice for a while. Requirements are not anything fancy, just working binding with a nice API. I also found Mogwai dataBinding, but it seems quite incomplete and requires manual synchronization activation, which makes it useless compared to coarse grained synchronization easily written by hand. Incomplete frameworks include at least Spring RCP and many JSR-296 forks. So, is the JGoodies data binding really the only realistic choice? Or are there any other viable solutions available?

    Read the article

  • Custom Swing component: questions on approach

    - by phatmanace
    Hi Folks, I'm trying to build a new java swing component, I realise that I might be able to find one that does what I need on the web, but this is partly an exercise for me to learn ow to do this. I want to build a swing component that represents a Gantt chart. it would be good (though not essential for people to be able to interact with it (e.g slide the the tasks around to adjust timings) it feels like the best approach for this is to subclass JComponent, and override PaintComponent() to 'draw a picture' of what the chart should look like, as opposed to doing something like trying to jam everything into a custom JTable. I've read a couple of books on the subject, and also looked at a few examples (most notably things like JXGraph) - but I'm curious about a few things When do I have to switch to using UI delegates, and when can I stick to just fiddling around in paintcomponent() to render what I want? if I want other swing components as sub-elements of my component (e.g I wanted a text box on my gantt chart) can I no longer use paintComponent()? can I arbitrarily position them within my Gantt chart, or do I have to use a normal swing layout manager many thanks in advance. -Ace

    Read the article

  • Which swing testing frameworks are well suited to TDD?

    - by Niel de Wet
    I am trying to follow a BDD/TDD approach to developing an IntelliJ IDEA plugin, and in order to do a full acceptance test I want to exercise my plugin through the GUI. I know that I can do it using Window Licker, but looking at the commit log there hasn't been any activity since 2010. I see there are several other frameworks, but which are current and suited for TDD? If you have any experience with swing and TDD, please share those as well.

    Read the article

  • Displaying emails in a JTable (Java Swing)

    - by Paul
    Hi I'm new to all this. I have been trying to display fetched emails in a JTable using the JavaMail add-on. However when I ask the program to set the value it never does. I have been working in NetBeans if that is any help? the fetchMail class finds all may on a server. The gui class is used to display all emails in a table as well as creating mail. You will probably think that I have tried it like a bull in a china shop, I am new to Java and trying to give myself a challenge. Any help/advice would be greatly appreciated fetchMail: package mail; import java.util.; import java.io.; import java.text.DateFormat; import java.text.SimpleDateFormat; import javax.mail.; import javax.mail.internet.; import javax.mail.search.; import javax.activation.; public class fetchMail { public void fetch(String username, String pass, String search){ MessagesTableModel tableModel = new MessagesTableModel(); String complete; DateFormat df = new SimpleDateFormat("dd/MM/yyyy"); gui gui = new gui(); // SUBSTITUTE YOUR ISP's POP3 SERVER HERE!!! String host = "imap.gmail.com"; // SUBSTITUTE YOUR USERNAME AND PASSWORD TO ACCESS E-MAIL HERE!!! String user = username; String password = pass; // SUBSTITUTE YOUR SUBJECT SUBSTRING TO SEARCH HERE!!! String subjectSubstringToSearch = search; // Get a session. Use a blank Properties object. Session session = Session.getInstance(new Properties()); Properties props = System.getProperties(); props.setProperty("mail.store.protocol", "imaps"); props.setProperty("mail.imap.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); props.setProperty("mail.imap.socketFactory.fallback", "false"); try { // Get a Store object Store store = session.getStore("imaps"); store.connect(host, user, password); // Get "INBOX" Folder fldr = store.getFolder("INBOX"); fldr.open(Folder.READ_WRITE); int count = fldr.getMessageCount(); System.out.println(count + " total messages"); // Message numebers start at 1 for(int i = 1; i <= count; i++) { // Get a message by its sequence number Message m = fldr.getMessage(i); // Get some headers Date date = m.getSentDate(); int pos = i - 1; String d = df.format(date); Address [] from = m.getFrom(); String subj = m.getSubject(); String mimeType = m.getContentType(); complete = date + "\t" + from[0] + "\t" + subj + "\t" + mimeType; //tableModel.setMessages(m); gui.setDate(d, pos); // System.out.println(d + " " + i); } // Search for e-mails by some subject substring String pattern = subjectSubstringToSearch; SubjectTerm st = new SubjectTerm(pattern); // Get some message references Message [] found = fldr.search(st); System.out.println(found.length + " messages matched Subject pattern \"" + pattern + "\""); for (int i = 0; i < found.length; i++) { Message m = found[i]; // Get some headers Date date = m.getSentDate(); Address [] from = m.getFrom(); String subj = m.getSubject(); String mimeType = m.getContentType(); //System.out.println(date + "\t" + from[0] + "\t" + // subj + "\t" + mimeType); Object o = m.getContent(); if (o instanceof String) { // System.out.println("**This is a String Message**"); // System.out.println((String)o); } else if (o instanceof Multipart) { // System.out.print("**This is a Multipart Message. "); Multipart mp = (Multipart)o; int count3 = mp.getCount(); // System.out.println("It has " + count3 + // " BodyParts in it**"); for (int j = 0; j < count3; j++) { // Part are numbered starting at 0 BodyPart b = mp.getBodyPart(j); String mimeType2 = b.getContentType(); // System.out.println( "BodyPart " + (j + 1) + // " is of MimeType " + mimeType); Object o2 = b.getContent(); if (o2 instanceof String) { // System.out.println("**This is a String BodyPart**"); // System.out.println((String)o2); } else if (o2 instanceof Multipart) { // System.out.print( // "**This BodyPart is a nested Multipart. "); Multipart mp2 = (Multipart)o2; int count2 = mp2.getCount(); // System.out.println("It has " + count2 + // "further BodyParts in it**"); } else if (o2 instanceof InputStream) { // System.out.println( // "**This is an InputStream BodyPart**"); } } //End of for } else if (o instanceof InputStream) { // System.out.println("**This is an InputStream message**"); InputStream is = (InputStream)o; // Assumes character content (not binary images) int c; while ((c = is.read()) != -1) { // System.out.write(c); } } // Uncomment to set "delete" flag on the message //m.setFlag(Flags.Flag.DELETED,true); } //End of for // "true" actually deletes flagged messages from folder fldr.close(true); store.close(); } catch (MessagingException mex) { // Prints all nested (chained) exceptions as well mex.printStackTrace(); } catch (IOException ioex) { ioex.printStackTrace(); } } } gui: /* * gui.java * * Created on 13-May-2010, 18:29:30 */ package mail; import java.text.DateFormat; import java.text.FieldPosition; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Vector; import javax.mail.Address; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.ListSelectionModel; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.event.TableModelListener; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableModel; public class gui extends javax.swing.JFrame { private MessagesTableModel tableModel; // Table listing messages. private JTable table; String date; /** Creates new form gui */ public gui() { initComponents(); } @SuppressWarnings("unchecked") private void initComponents() { recieve = new javax.swing.JButton(); jButton1 = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); inboxTable = new javax.swing.JTable(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); recieve.setText("Receve"); recieve.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { recieveActionPerformed(evt); } }); jButton1.setText("new"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); inboxTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null} }, new String [] { "Date", "subject", "sender" } ) { Class[] types = new Class [] { java.lang.String.class, java.lang.String.class, java.lang.String.class }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } }); jScrollPane1.setViewportView(inboxTable); inboxTable.getColumnModel().getColumn(0).setResizable(false); inboxTable.getColumnModel().getColumn(1).setResizable(false); inboxTable.getColumnModel().getColumn(2).setResizable(false); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(39, 39, 39) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 558, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup() .addComponent(recieve) .addGap(18, 18, 18) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(73, 73, 73)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(31, 31, 31) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(recieve) .addComponent(jButton1)) .addGap(18, 18, 18) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(179, Short.MAX_VALUE)) ); pack(); }// </editor-fold> private void recieveActionPerformed(java.awt.event.ActionEvent evt) { fetchMail fetch = new fetchMail(); fetch.fetch(email goes here, password goes here, search goes here); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { createMail create = new createMail(); centerW center = new centerW(); //create.attVis(); center.center(create); create.setVisible(true); } public void setDate(String Date, int pos){ //pos = pos + 1; String [] s = new String [5]; s[pos] = Date; inboxTable.setValueAt(Date, pos, 0); } public String getDate(){ return date; } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new gui().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JTable inboxTable; private javax.swing.JButton jButton1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JButton recieve; // End of variables declaration }

    Read the article

  • Java Swing or Java Qt?

    - by Gili
    Can someone with extensive experience with both Qt and Java Swing please discuss whether you would use Swing or Qt under Java, and why? Secondly, what is the business impact of using Qt? Is it reasonably popular or will I have a hard time finding experienced Qt developers? Are there any other business impacts I should be aware of? UPDATE: I am more interested in the technical and business impacts of Swing vs Qt than the license type/fee since in my case the cost is not a concern.

    Read the article

  • NetBeans create and instantiate programatically custom swing widgets

    - by RenegadeAndy
    Hey! I have a problem I know how I would solve easily developing under eclipse - but not so easily developing under net beans. I want to create a custom swing widget - which I can instantiate by code as many as I need and attach them to my main panel. I have developed the rest of the GUI using the GUIBuilder. The problem is - im not entirely sure how to do this. Say I got 20 results back from a web service, I would wana loop round - and add 20 of these custom swing widgets - the custom swing widgets would look as follows : :Picture: :Label: :Label: Can anybody please help me, im not entirely sure how to do the custom widget either! Thanks in advance for any support. Andy

    Read the article

  • How to use a delay in a swing application

    - by M.R.
    I am building a swing application. At some point, I have to start an "animation": ... jpanel1.setBackground(Color.Black); Delay(milli) jpanel1.setBackground(Color.White); ... and so on. The gui itself and all the logic behind it work.It is just this time depended color-changing that does not. I have read, that swing is not thread safe, but all the examples I found showed me how to start another thread (for example in the background) but never how to stop the current swing-gui thread.

    Read the article

  • Using HTML in Swing Applications

    - by Padur
    Hello all Need some help here..I am trying to write a simple swing application which displays some text based on user actions. Its like help where user clicks on some url and he is redirected to that page. I have huge html code and I want to render it in swing components. I was able to do it in JDK1.6 software but not in JDK1.4. Is there any way we can render complex html in swing components in JDK 1.4 software? I appreciate help. Thanks Padur

    Read the article

  • Java swing doesn't show changes to source

    - by out_sider
    I'm using Java Swing graphical editor with netbeans to make my project...but using it brings some limitations like I can't add to a jpanel an image,using java swing options. So i'll need to code it, implementing a new jPanel. My problem is that the code generated by the java swing graphical editor can't be edited so instead of adding the new JPanel code in the initComponents() section I'm doing it after this function is called in the constructor of my main JPanel. But any code I add is not recognized by the "Designer" which means that after making my coded objects I can't use them in the "Designer" and everything must be coded, which is a pain considering how much easier is previewing and moving elements in the "Designer" tool. How can I code what I want but steel appear in the "DEsigner"? Thx in advance

    Read the article

  • All parts of my Printable Swing component doesn't print

    - by Jonas
    I'm trying to do a printable component (an invoice document). I use JComponent instead of JPanel because I don't want a background. The component has many subcomponents. The main component implements Printable and has a print-method that is calling printAll(g) so that all subcomponents should be printed. But my subcomponents doesn't print. What am I missing? Does all subcomponents also has to implement Printable? import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.GridLayout; import java.awt.print.PageFormat; import java.awt.print.Printable; import java.awt.print.PrinterException; import java.awt.print.PrinterJob; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; public class PPanel extends JComponent implements Printable { static double w; static double h; public PPanel() { this.setLayout(new BorderLayout()); this.add(new JLabel("Document Body"), BorderLayout.CENTER); this.add(new Header(), BorderLayout.NORTH); this.add(new Footer(), BorderLayout.SOUTH); } class Header extends JComponent { public Header() { this.setLayout(new BorderLayout()); this.add(new TopHeader(), BorderLayout.NORTH); this.add(new LowHeader(), BorderLayout.SOUTH); } } class TopHeader extends JComponent { public TopHeader() { this.setLayout(new BorderLayout()); JLabel companyName = new JLabel("Company name"); JLabel docType = new JLabel("Document type"); this.add(companyName, BorderLayout.WEST); this.add(docType, BorderLayout.EAST); } } class LowHeader extends JComponent { public LowHeader() { this.setLayout(new GridLayout(0,2)); JLabel col1 = new JLabel("Column 1"); JLabel col2 = new JLabel("Column 2"); this.add(col1); this.add(col2); } } class Footer extends JComponent { public Footer() { this.setLayout(new GridLayout(0,2)); JLabel addr = new JLabel("Address"); JLabel sum = new JLabel("Sum"); this.add(addr); this.add(sum); } } public static void main(String[] args) { final PPanel p = new PPanel(); PrinterJob job = PrinterJob.getPrinterJob(); job.setPrintable(p); try { job.print(); } catch (PrinterException ex) { // print failed } // Preview new JFrame() {{ getContentPane().add(p); this.setSize((int)w, (int)h); setVisible(true); }}; } @Override public int print(Graphics g, PageFormat pf, int page) throws PrinterException { if (page > 0) { return NO_SUCH_PAGE; } Graphics2D g2d = (Graphics2D)g; g2d.translate(pf.getImageableX(), pf.getImageableY()); w = pf.getImageableWidth(); h = pf.getHeight(); this.setSize((int)w, (int)h); this.setPreferredSize(new Dimension((int)w, (int)h)); this.doLayout(); this.printAll(g); return PAGE_EXISTS; } }

    Read the article

  • Image not loading onto JPanel?

    - by None None
    I have been trying to figure out how to add an image to a JPanel as a background, but still have complete control over the placing of JButtons, JLabels, and etc. This is one method I found, but it is crashing and not loading the image or buttons. Here is the code: import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JButton; import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.GridLayout; public class PanelDemo extends JFrame { private static final long serialVersionUID = 1L; private JButton btn1 = new JButton("EASY"); private JButton btn2 = new JButton("MEDIUM"); private JButton btn3 = new JButton("HARD"); private JButton btn4 = new JButton("High Score"); public PanelDemo() { super("Image Panel Demo"); JPanel panel = new ImagePanel( new FlowLayout(FlowLayout.CENTER, 50, 180)); JPanel panelbtn = new JPanel(new GridLayout(4, 1)); btn1.setBackground(new java.awt.Color(0, 0, 0)); btn1.setFont(new java.awt.Font("Showcard Gothic", 1, 24)); btn1.setForeground(new java.awt.Color(0, 255, 102)); btn2.setBackground(new java.awt.Color(0, 0, 0)); btn2.setFont(new java.awt.Font("Showcard Gothic", 1, 24)); btn2.setForeground(new java.awt.Color(0, 255, 102)); btn3.setBackground(new java.awt.Color(0, 0, 0)); btn3.setFont(new java.awt.Font("Showcard Gothic", 1, 24)); btn3.setForeground(new java.awt.Color(0, 255, 102)); btn4.setBackground(new java.awt.Color(0, 0, 0)); btn4.setFont(new java.awt.Font("Showcard Gothic", 1, 24)); btn4.setForeground(new java.awt.Color(0, 255, 102)); panel.add(panelbtn); panelbtn.add(btn1); panelbtn.add(btn2); panelbtn.add(btn3); panelbtn.add(btn4); add(panel, BorderLayout.CENTER); setSize(640, 480); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public static void main(String... args) { new PanelDemo().setVisible(true); } } ImagePanel.java import java.awt.Graphics; import java.awt.Image; import java.awt.LayoutManager; import javax.swing.ImageIcon; import javax.swing.JPanel; public class ImagePanel extends JPanel { private static final long serialVersionUID = 1L; String imageFile = "/rsc/img/background.jpg"; public ImagePanel() { super(); } public ImagePanel(String image) { super(); this.imageFile = image; } public ImagePanel(LayoutManager layout) { super(layout); } public void paintComponent(Graphics g) { ImageIcon imageicon = new ImageIcon(getClass().getResource(imageFile)); Image image = imageicon.getImage(); super.paintComponent(g); if (image != null) g.drawImage(image, 0, 0, getWidth(), getHeight(), this); } } Error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.ImageIcon.<init>(Unknown Source) at ImagePanel.paintComponent(ImagePanel.java:27) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JComponent.paintChildren(Unknown Source) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JComponent.paintChildren(Unknown Source) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JLayeredPane.paint(Unknown Source) at javax.swing.JComponent.paintChildren(Unknown Source) at javax.swing.JComponent.paintToOffscreen(Unknown Source) at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source) at javax.swing.RepaintManager$PaintManager.paint(Unknown Source) at javax.swing.RepaintManager.paint(Unknown Source) at javax.swing.JComponent.paint(Unknown Source) at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source) at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source) at sun.awt.SunGraphicsCallback.runComponents(Unknown Source) at java.awt.Container.paint(Unknown Source) at java.awt.Window.paint(Unknown Source) at javax.swing.RepaintManager$3.run(Unknown Source) at javax.swing.RepaintManager$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source) at javax.swing.RepaintManager.access$1000(Unknown Source) at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$200(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Also, if anyone knows of a better way to put a background image on a JPanel, pease do tell. Thank you in advance.

    Read the article

  • Automated tests for Java Swing GUIs

    - by pauldoo
    What options are there for building automated tests for GUIs written in Java Swing? I'd like to test some GUIs which have been written using the NetBeans Swing GUI Builder, so something that works without requiring special tampering of the code under test would be ideal.

    Read the article

  • Why Java Swing behaves different on different systems?

    - by Tom Brito
    Some swing code I write in my computer behave different on my colleague's computer, and in my PC, and in my notebook. I wonder, is there something I can do to my Swing applications behave the same in every computer? I want to have sure a algorithm I've tested in my computer will work the same way in my clients computers. E.g. Problem to focus JTextField

    Read the article

  • Grouping swing objects

    - by RenegadeAndy
    Hey. I want to make an object I can add to my java swing application. The object when instantiated would contain an image and 2 labels - is there a way to do this using java swing? If there is - can you point me at an example. I.e i want Myobj icon = new MyObj(pic, label , label); window.addComponent(icon); Cheers Andy

    Read the article

  • Memory Leak with Swing Drag and Drop

    - by tom
    I have a JFrame that accepts top-level drops of files. However after a drop has occurred, references to the frame are held indefinitely inside some Swing internal classes. I believe that disposing of the frame should release all of its resources, so what am I doing wrong? Example import java.awt.datatransfer.DataFlavor; import java.io.File; import java.util.List; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.TransferHandler; public class DnDLeakTester extends JFrame { public static void main(String[] args) { new DnDLeakTester(); //Prevent main from returning or the jvm will exit while (true) { try { Thread.sleep(10000); } catch (InterruptedException e) { } } } public DnDLeakTester() { super("I'm leaky"); add(new JLabel("Drop stuff here")); setTransferHandler(new TransferHandler() { @Override public boolean canImport(final TransferSupport support) { return (support.isDrop() && support .isDataFlavorSupported(DataFlavor.javaFileListFlavor)); } @Override public boolean importData(final TransferSupport support) { if (!canImport(support)) { return false; } try { final List<File> files = (List<File>) support.getTransferable().getTransferData(DataFlavor.javaFileListFlavor); for (final File f : files) { System.out.println(f.getName()); } } catch (Exception e) { e.printStackTrace(); } return true; } }); setDefaultCloseOperation(DISPOSE_ON_CLOSE); pack(); setVisible(true); } } To reproduce, run the code and drop some files on the frame. Close the frame so it's disposed of. To verify the leak I take a heap dump using JConsole and analyse it with the Eclipse Memory Analysis tool. It shows that sun.awt.AppContext is holding a reference to the frame through its hashmap. It looks like TransferSupport is at fault. What am I doing wrong? Should I be asking the DnD support code to clean itself up somehow? I'm running JDK 1.6 update 19.

    Read the article

  • create setup in java swing application

    - by adesh
    I am working on java swing application in which i have to give html files to the client to browse them in swing API. Now i want to create the setup for the project so that user could install the software on their computer and i want to include html files , java classes some jar files and ms access database also how could i use the path of directory created after the installation of software. Please suggest the code if possible

    Read the article

  • Plugin support for a Java swing App (like Eclipse)

    - by Sudar
    I need to add Plugin support to a Java Swing App (like in Eclipse). The Plugin should have the ability to add new Menu items and tab components to the swing app. I am looking for frameworks or libraries which support it. So far I have found Java Plugin Framework http://jpf.sourceforge.net/ and planning to use it. Are there any other better alternatives to it?

    Read the article

  • swing syntax highlighter

    - by Simon
    Hi, I need some advice on creating a syntax highligher for java application using swing. The application should allow to edit a file and highlight syntax. I don't know the swing library, what should I look for?

    Read the article

  • How to disable a container and its children in Swing

    - by Fuzzy76
    I cannot figure out a way to disable a container AND its children in Swing. Is Swing really missing this basic feature? If I do setEnabled(false) on a container, its children are still enabled. My GUI structure is pretty complex, and doing a traversion of all elements below the container is not an option. Neither is a GlassPane on top of the container (the container is not the entire window).

    Read the article

  • Swing and handling threads

    - by James P.
    There's a couple questions here on StackOverflow on the subject of threading with the Swing api but things still aren't clear. What is the issue with the EDT, what is the proper way to initiate a Thread with Swing and in what cases should it be used? P.S: Any sources in terms of good practises would be appreciated.

    Read the article

  • Extending a Java Swing class in Clojure

    - by mikera
    I'm trying to extend a Java Swing component in Clojure, i.e. I want to extend a javax.swing.JComponent and add some custom methods implemented in pure Clojure in addition to all the standard inherited methods. I've tried using "proxy" which works great if I just want a single instance (in the same way as an anonymous inner class). However I'd really like a named class so that I can generate an arbitrary number of instances. What's the recommended way of doing this?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >