Search Results

Search found 1571 results on 63 pages for 'swing'.

Page 29/63 | < Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >

  • JNLP File Association: How do I open the file which was double-clicked on?

    - by Sam Barnum
    I've got the following JNLP: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Descriptor 6.0.10//EN" "http://java.sun.com/dtd/JNLP-6.0.10.dtd"> <jnlp spec="6.0.10" version="1.63" codebase="http://foo.example.com/msi" href="Foo.jnlp"> <information> <title>Foo</title> <vendor> Foo Systems, Inc.</vendor> <homepage href="http://Foo.com"/> <description>Foo Viewer/Editor Application</description> <icon href="splash.gif" width="425" height="102" kind="splash"/> <icon href="Foo.gif" width="64" height="64"/> <offline-allowed/> <shortcut> <desktop/> <menu submenu="Foo Systems, Inc."/> </shortcut> <association mime-type="application-x/wlog" extensions="wlog"/> <association mime-type="application-x/mplot" extensions="mplot"/> </information> <security> <all-permissions/> </security> <resources> <j2se version="1.6+" initial-heap-size="32m" max-heap-size="255m"/> <jar href="jars_deployment/TimingFramework-1.0.jar"/> <jar href="jars_deployment/iText-2.1.5.jar"/> <jar href="jars_deployment/jai_codec.jar"/> <jar href="Foo.jar"/> <jar href="jars_deployment/TimingFramework-1.0.jar"/> <jar href="jars_deployment/iText-2.1.5.jar"/> <jar href="jars_deployment/jai_codec.jar"/> <jar href="jars_deployment/jsch-20090402.jar"/> <property name="apple.laf.useScreenMenuBar" value="true"/> <property name="apple.awt.graphics.UseQuartz" value="false"/> <property name="com.apple.mrj.application.apple.menu.about.name" value="Foo"/> <property name="java.util.logging.config.file" value="/Users/Shared/logging.properties"/> </resources> <application-desc main-class="com.prosc.msi.editor.ui.test.Sandbox"/> </jnlp> Most everything is working. When I double-click a .wlog file, it opens up my application. However, it doesn't open the correct file. I read somewhere that JNLP was supposed to pass parameters to the main method indicating which file caused the app to be launched, but this is not happening (on OS X 10.6). I get an empty array to my application's main method. Probably unrelated, my splash screen doesn't work :( Any pointers on getting this working?

    Read the article

  • How can i setParth for new File use JFilechose , save dialog ?

    - by tiendv
    I have a dialog use Jfilechose, when i save a file by use FileOutputStream to create a file.txt to save in path which user want . But i have problem that it alway save in c:/user/Document Check my code DownLoadDialog downloadDialog = new DownLoadDialog(); int result = downloadDialog.showSaveDialog(queryPanel); if(result == downloadDialog.APPROVE_OPTION) { File file = downloadDialog.getSelectedFile(); //String parth =file.getPath(); //System.out.println(parth); //if(file.exists()) { // int response = JOptionPane.showConfirmDialog (null,"Overwrite existing file?","Confirm Overwrite",JOptionPane.OK_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE); // if(response == JOptionPane.OK_OPTION) {} //} else { if(resultGoogleSearch > 0) { { String parth = new File(downloadDialog.getSelectedFile().getAbsolutePath().concat(".txt")).toString(); System.out.println(parth); for(int i=0;i<resultGoogleSearch;i++) { String[] temp = googleSearchResult.get(i).split("<br>"); //String resultURL = temp[0]; //File dir = downloadDialog.getCurrentDirectory(); try{ FileOutputStream googleReuslt = new FileOutputStream( downloadDialog.getSelectedFile().getAbsolutePath()+".txt" ); OutputStreamWriter writer = new OutputStreamWriter(googleReuslt); BufferedWriter buffer = new BufferedWriter(writer); writer.write(temp[0]); writer.close(); buffer.close(); } catch (FileNotFoundException fEx){ } catch(IOException ioEx) { } } } JOptionPane.showMessageDialog(IDRSApplication.idrsJFrame, IDRSResourceBundle.res.getString("successful")); } problem is here : why can't i set parth for new file ? FileOutputStream googleReuslt = new FileOutputStream( downloadDialog.getSelectedFile().getAbsolutePath()+".txt" ); OutputStreamWriter writer = new OutputStreamWriter(googleReuslt); BufferedWriter buffer = new BufferedWriter(writer); writer.write(temp[0]); writer.close(); buffer.close();

    Read the article

  • Auto-hide JMenuBar

    - by PeterMmm
    When i run the code above the frame's menu bar come up when the mouse moves to the upper part of the window. The problem is when i open the menu but do not select any item and move out the mouse the menu bar get invisible but the items stay on screen. public class Test extends JFrame { public Test() { setLayout(new BorderLayout()); setSize(300, 300); JMenuBar mb = new JMenuBar(); setJMenuBar(mb); mb.setVisible(false); JMenu menu = new JMenu("File"); mb.add(menu); menu.add(new JMenuItem("Item-1")); menu.add(new JMenuItem("Item-2")); addMouseMotionListener(new MouseAdapter() { @Override public void mouseMoved(MouseEvent e) { getJMenuBar().setVisible(e.getY() < 50); } }); } public static void main(String args[]) { new Test().setVisible(true); } }

    Read the article

  • JLayeredPane versus Container layering

    - by Gili
    JLayeredPane allows one to stack multiple Components on top of one another using JLayeredPane.add(Component, Integer). Components in higher "layers" display on top of Components in lower "layers". Container.add(Component, int) provides a similar mechanism whereby Components with lower indexes display on top of Components with higher indexes. Please note that the first mechanism uses Integer and the second mechanism uses int. Also, one renders high values on top of low ones, and the other does the opposite. Do not mix the two :) My question is: what's the point of using JLayeredPane when Container already provides the same mechanism? Does one layer components better than the another? UPDATE: There is also Container.setComponentZOrder(Component, int) to consider.

    Read the article

  • How to make JTabbedPane autoresize to fit page dimensions?

    - by teamon
    I have only JTabbedPane inside JFrame. JTabbedPane sets its dimensions to biggest page width/height. As pages has different size is it possible to force JTabbedPane to change its dimensions when selecting other page? http://grab.by/3hIg Top one is how it behave now and bottom one is how i want it to behave (i resized frame by hand)

    Read the article

  • Window z-ordering in java

    - by Aaron
    Is there a way to manage the window z-ordering of JDialog windows within java? I would like to able to assign each window to a layer such that windows on lower layers can never go above and obscure windows on higher layers. Even when they have focus. Similar to the Z-order capability that exists for components but for JDialog windows. The solution does not need to work across all OSes. A linux specific solution is acceptable.

    Read the article

  • JPanel on top of JLabel

    - by newbie
    Good day! Is it possible to add a JPanel on top of a JLabel? I would like my JFrame to have a background image and in order to this, i used this code (based from past stackoverflow answers): setLocation(150,50); setSize(700,650); setVisible(true); JLabel contentPane = new JLabel(); contentPane.setIcon(new ImageIcon("pics/b1.jpg")); contentPane.setLayout( new BorderLayout()); setContentPane( contentPane ); Now my problem is, I cannot put a panel on my JFrame because of the JLabel background. Please help. Thanks.

    Read the article

  • How To Keep Size Of JTextArea constant?

    - by Supereme
    Hi! I'm using an object of JTextArea in my application which deals with sending sms. I've used a DocumentFilter so as to allow only 160 characters to be typed in the textarea but now, I want the size of the textarea to be constant. it goes on increasing if I keep writing on the same line without pressing 'enter' key or even when I keep on pressing only 'enter' key. I tried once using 'scrollbar' too but the problem remains same. Suggest me something over this.

    Read the article

  • problem with jtabbedpane in java..

    - by mani
    hai, is it possible to loading of tabs in jtabedpane dyanamically in java.. that means i have frame that consinting of one tabbedpane.. in that i have 10 tabs and in each tab consting of another tabbedpane and in that each tabbedpane has 4 tabs and each tab consisting buttons and textfields...... when i login into my project the next frame takes more time to visible.... this is happens why because i have more tabbedpanes in my frame so that it takes the lot's of time to visible.. my question is.. is it possible to load tabs content dynamically when i click the tab in tabbedpane..... or is it possible to load tabbedpanes fastly......????????

    Read the article

  • Implementing Drag and Drop using MouseListener for custom Components

    - by Chris Lieb
    I am working on a school assignment that requires me to be able to pick up a tile, drag it to a location, then drop it there. I was able to get this working using TransferHandler and a bunch of stuff from the dnd package, but this is not an acceptable way to perform this action for this assignment according to the professor. So, I am trying to achieve the same effect using the MouseListener interface. The basic setup is this: I have a JPanel-derived class called LocationView that contains JLabel-dervived instances of TileView. I need to get events that give me the LocationView that has the mouse pressed on and the LocationView that has the mouse released on. I am proxying mouse events through the TileView to its containing LocationView so that I can properly handle the mousePressed event. I added System.out.println()'s to the mouse listeners for mousePressed and mouseReleased to both LocationView and TileView so that I could observe the events that were being generated. To my surprise, pressing the mouse on Tile A in Location A, then dragging to Location B and releasing would generate a mouse released event for both Tile A and Location A, but not for Location B. I need the mouse released event triggered for only Location B. To try to work around this, I tried implementing a glass pane based off of the FinalGlassPane found at http://weblogs.java.net/blog/2006/09/20/well-behaved-glasspane. After adding the glass pane and adding an event listener for it, I can see that the mouse events are indeed filtering through the glass pane, but the mouse released event is still only being called on the item the mouse was clicked on. Is there a way to have mousePressed and mouseReleased events associated with the same drag action be called on separate components?

    Read the article

  • Using JLabels as pseudo buttons.

    - by FreeThinker
    Currently I am developing a small todo list manager and would like to use labels in place of buttons on the 'context' bar. If any one could provide me with information on how I could go about doing this I would appreciate it greatly.

    Read the article

  • Jlabel with alpha value

    - by jouzef19
    Hi: i have jLabel and i want to change its opacity (alpha value) each one second , i tried something like that but its not change each one second , jlable change its opacity with last alpha value . Color color = jLabel1.getBackground(); int alpha = 255; long initTime = System.currentTimeMillis(); while(true){ if(System.currentTimeMillis() - initTime >= 1000){ initTime = System.currentTimeMillis(); alpha -=1; Color color2 = new Color(color.getRed(),color.getGreen(),color.getBlue(),alpha); jLabel1.setBackground(color2); } if(alpha<=0) break; }

    Read the article

  • Java login form with database connection

    - by Muhammed Yoosuf
    I am creating a login form in java by having a database connection, and I need 2 open DIFFERENT forms for each user. However, all of the three forms open except for one. The forms I have are, MAinWindow Nursery Primary Secondary ALL THE FORMS OPEN except for the nursery form, when I enter the correct username it displays the Primary form. ANY HELP SOON char[] DBUserArray; DBUserArray=name.toCharArray(); char [] DBPassArray; DBPassArray=pass.toCharArray(); char AdminArray []=AdminUser.toCharArray(); char NurArray []=NurHead.toCharArray(); char[] PriArray =PriHead.toCharArray(); char[] SecArray=SecHead.toCharArray(); char[] input = txtpassword.getPassword(); String user=txtusername.getText(); char [] userString; userString=user.toCharArray(); if(userString.length!=DBUserArray.length && input.length!=DBPassArray.length) { JOptionPane.showMessageDialog(null, "Username and Password Wrong","User Login",JOptionPane.ERROR_MESSAGE); } else { if(userString.length!=AdminArray.length) { if(userString.length!=PriArray.length) { if(userString.length!=NurArray.length) { if(userString.length!=SecArray.length) { } else { new Secondary().setVisible(true); setVisible(false); } } else { new Nursery().setVisible(true); setVisible(false); } } else { new Primary().setVisible(true); setVisible(false); } } else { new MainWindow().setVisible(true); setVisible(false); } }

    Read the article

  • Restrict number of lines in html JLabel

    - by Mike
    I have a JLabel that needs to display some html-formatted text. However, I want to restrict this to being 4 lines long (and if so, provide a button to see everything). So far, I've tried setting the maximum size manually or via a layout manager. However, both of these solutions can cause part of a line to be displayed.

    Read the article

  • Why is my GUI unresponsive while a SwingWorker thread runs?

    - by Starchy
    Hello, I have a SwingWorker thread with an IOBound task which is totally locking up the interface while it runs. Swapping out the normal workload for a counter loop has the same result. The SwingWorker looks basically like this: public class BackupWorker extends SwingWorker<String, String> { private static String uname = null; private static String pass = null; private static String filename = null; static String status = null; BackupWorker (String uname, String pass, String filename) { this.uname = uname; this.pass = pass; this.filename = filename; } @Override protected String doInBackground() throws Exception { BackupObject bak = newBackupObject(uname,pass,filename); return "Done!"; } } The code that kicks it off lives in a class that extends JFrame: public void actionPerformed(ActionEvent event) { String cmd = event.getActionCommand(); if (BACKUP.equals(cmd)) { SwingUtilities.invokeLater(new Runnable() { public void run() { final StatusFrame statusFrame = new StatusFrame(); statusFrame.setVisible(true); SwingUtilities.invokeLater(new Runnable() { public void run () { statusFrame.beginBackup(uname,pass,filename); } }); } }); } } Here's the interesting part of StatusFrame: public void beginBackup(final String uname, final String pass, final String filename) { worker = new BackupWorker(uname, pass, filename); worker.execute(); try { System.out.println(worker.get()); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } } } So far as I can see, everything "long-running" is handled by the worker, and everything that touches the GUI on the EDT. Have I tangled things up somewhere, or am I expecting too much of SwingWorker?

    Read the article

  • How can i underline a text in JDK5, NOT JDK6

    - by Serkan Kasapbasi
    when i search internet i have found a way to underline font like this, Font f=jLabel1.getFont(); Map<TextAttribute,Object> map = new Hashtable<TextAttribute,Object>(); map.put(TextAttribute.UNDERLINE,TextAttribute.UNDERLINE_ON); f=f.deriveFont(map); jLabel1.setFont(f); it works well on jdk6, however it doesnt work on jdk5, and it doesnt warn about anything. first, how can i get same effect on jdk5? second, why is there a TextAttribute.UNDERLINE constant, if it doesnt work?

    Read the article

  • issue about Concept of JFrame, JLabel and ContentPane

    - by Sun Hong Kim
    I just study window programming with awt. I see through several codes but I can not get concepts of JFrame, JLabel and ContentPane. I think JFrame only make outer Frame. ContentPane is container that contain JLabel that has contents(text, button, radio etc...). I don't know this is correct T.T Why I ask this is I failed combine the contents. I can not make TextField and InternalFrame at a time. I want to know the concept. I hope you take my question right.

    Read the article

  • How to represent double values as circles in a 2d matrix in java

    - by marco
    Hello, so I want to write a matrix explorer which enables me to reorder rows and columns of a matrix. For this porpouse I used the Jtable class. Now the problem that I have is that it is very difficult to reorder a matrix by looking at double values, so I would like to print the matrix not with the double values but with circles in which the radius of the circle represents the value. So that I can tell the difference between big values and small values quicker. Anybody has any idea how I can turn this double values into filled circles with JTable or any table class for that matter?

    Read the article

< Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >