Runtime « Development « Java Swing Q&A





1. How to handle a GUI of an external software from within Java code    stackoverflow.com

I need to run an external application from within my Java code. I can run the application with Runtime r = Runtime.getRuntime() and then r.exec(...), however, this brings up the GUI ...

2. How do I integrate GUI elements from different classes at runtime?    stackoverflow.com

I'm trying to "future-proof" an application that I'm writing by splitting out those elements that are likely to change over time. In my application I need to be able to adapt ...

3. Java - Add Swing component at Runtime WITH a reference name?    stackoverflow.com

I am currently working on an app that adds JTextFields to a panel at runtime using:

int rowCounter = 1;            ...

4. Runtime.getRuntime.exec() problem    stackoverflow.com

hi I am trying to execute the Runtime.getRuntime.exec("ffmpeg -i inputfile image2 imagefile"); the input file in my code is the video file and i'm selecting the video file through the GUI and i store ...

5. GUI in Java.. generating a run time component    stackoverflow.com

I have an User Interface where the user inputs a number (10 for example) in a textfeild then if the user presses enter I want 10 text feilds to be generated in ...

6. Dynamically Generate JComponent during runtime    stackoverflow.com

got anyways to dynamically generate JComponent like JTextField, JCombobox? What i try is work.., but can only add-on once which's declare as global variable. Got anyway likes changing variable Name during ...

7. How to have a java gui transition from one gui to another    stackoverflow.com

I am programming a gui in java and it has some buttons one of these buttons is options. I would like to have it so when you click on options ...

8. Discover Swing Component Variable Name At Runtime    stackoverflow.com

I'm not sue if this is even possible, but I have a Swing application that has on the order of four dozen different labels that I'm having to track down bugs ...

9. NetBeans GUI Builder Runtime help    forums.netbeans.org

Hi, I'm hoping this is an easy question, though I can't find an answer easily. I'm a teacher who has a number of students using NetBeans. One common error we come across is unable to view custom frames in design view, or being unable to drag custom panels into frames. "Error in loading component" or "null pointer" or "component cannot be ...





10. Runtime size modification of swing component    forums.netbeans.org

Hi all, i have to make some dynamic resize on component in a JFrame. For example i have: textfield A Button B As soon as i press button B i make a resize of the textfield A (e.g. scaling to 80%). But if i try to resize the outer jframe the textfield goes back to the original size!!!! How can i ...

11. runtime enviourment    coderanch.com

Hi I have an application in jfc that i want to install onto the clients machine.Now the clients machine does't have jdk1.3 installed on it,so now do i have to install jdk1.3 on the clients machine or what.i tried putting java.exe in the windows folder(it was just a wild try anyway)but it does'nt work. and anyway copying folder of jre won't ...

12. Adding controls at runtime    coderanch.com

Hello frens Is it possible to add swing controls at runtime??ie thing like conditional addition. I have a typical problem... I dont know before hand if i need to show a textbox or a combobox or some other control. I need to display appropriate control at runtime depending on the user who has logged in and his user preferences...so how can ...

13. Couldn't add items to a JCombboBox at runtime[very...... urgent......]    coderanch.com

Here is a simple example that adds to the box on the click of a button. import java.awt.event.*; import javax.swing.*; public class ComboTest extends JFrame { private JComboBox courseList; private JButton addCourse ; public ComboTest() { String[] courses = { new String( "Art" ), new String( "Math" ), new String( "English" ), new String( "Chemistry" ), new String( "Magic") }; courseList ...

14. Couldn't add items to a JCombboBox at runtime[very...... urgent......]    coderanch.com

Hi Netharam, The error is telling you that you must implement a mutable (i.e., changeable) model instead of a fixed one like you have done. Your ComboModel should look like the one below and you will be good to go. class NewComboModel extends NewLstModel implements MutableComboBoxModel { Vector objects = new Vector(); Object item; public void addElement( Object ob ) { ...

15. Run time exec problem    coderanch.com

Hi I would like to open a chm file from my "help" menu. I got two problem related to that: 1.The first time the menu is clicked i start the process and the help is opened on top of my application frame. but - the second time It is opened - the only wat to recognize i sthe process is still ...

16. How to get Table height in run time ?    coderanch.com

Hi all I make one Jtable in which data would be very in run time.. i have to find table height for this i am using table.setPreferedSize()..but it gives the static height of table... but i need actual height height which has been changed after filling data.. i wrote one renderer for change the table row height in run time according ...





17. swing lookandfeel Change at runtime affecting JButtonBar    coderanch.com

i All, Anyone any ideas why this is happening to me ? I have a frame with various panels all GridBagLayout, one being on the left containing a JButtonbar, with 4 buttons all stacked on top of each other again GB Layout.. Everything is cool, but when I call my Change Appearence dialog and select a new skin, as soon as ...

18. Setting properties in runtime    coderanch.com

19. Runtime Changes to Your GUI    coderanch.com

Hello, Can Swing components be generated dynamically at run time? A simple example would be, a mouse-click inside a Text Field would draw a new Text Field. Again, a mouse-click inside this new Text Field would draw a new Text Field again. There is no limit on number of created Text Fields. Here they describe how to replace or hide a ...

22. Unable to delete a list entry at runtime    coderanch.com

I'd recommend using the ListModel for adding / removing of items (like in the swing tutorials). Here's a working mini-example: public class JListDemo extends JFrame { final DefaultListModel lmItems; final JList liItems; final JTextField tfAddListItem; final JButton btAddListItem; final JButton btRemoveSelected; public JListDemo() { super( "FooBar" ); lmItems = new DefaultListModel(); liItems = new JList( lmItems ); tfAddListItem = new JTextField( ...

24. help with Runtime.getRuntime().exec    java-forums.org

Hey, I am trying to run another java program from mine using Runtime.getRuntime().exec. In my program I call a function that is supposed to append text to a JTextArea, then run Process p = Runtime.getRuntime().exec( java -cp ... ); I have two problems, the first is that It runs the java program FIRST, and when the java program is done, it ...

25. passing arument to runtime.getRuntime() method    java-forums.org

Hi, i have a code which creates scheduled task by executing runtime.getruntime method as follows, str = "schtasks /create /sc hourly /mo "+hrs +" /tn " +taskname+ " /tr python filename.py argument /ru " +username+ " /rp password"; Runtime run = Runtime.getRuntime(); Process pr = run.exec(str); now in file name i need to pass string "python filename.py argument" i tried creating ...

26. Runtime.getRuntime() and swing    forums.oracle.com

Iam trying to get the ouput of Runtime.getRuntime().exec(cmd); inside a frame when i press the button, but i can find i way of doing it, i had try JTextArea JTextField JLabel Graphics.drawString() but can't make it yet, someone knw how i can do it?? import java.io.*; import java.awt.*; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JButton; import javax.swing.JComponent; import java.awt.Toolkit; import java.awt.BorderLayout; import ...