Running Multiple Swing Applications
Hi There!
Is it possible to run a Swing program inside another Swing program!
(Example: A Swing animation etc).
Thanx for your feedback!
What I mean is, say you have a Swing
e a Swing animation which is a seperate application,
suppose if I wanna use it in another application, how
should I take it (or call it).Like I said: it depends on your design.
What class is the animation component. Is it its own class? Does it extends JFrame, JPanel, JComponent, ... ?
Similar Messages
-
What are the requirements to run a Swing application?
I'm trying to send a simple swing application to a friend that has Mac OSX, but the buttons don't show up.
Do people actually need the Java SDK in order for swing apps to work? Or is plain java enough? (He has normal java, because we play minecraft sometimes)
Anyway, my buttons are not showing up on his computer, not even when I use the cross platform look at feelHere is the code I'm using, it's an application that makes the user select a folder and stuff will happen to it.
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
public class SomeGUI extends JFrame implements ActionListener, Runnable
public JButton exit;
public JButton run;
JPanel panel;
JFileChooser chooser;
String returnpath;
JLabel progress;
public SomeGUI()
try
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
catch (ClassNotFoundException ex)
Logger.getLogger(SomeGUI.class.getName()).log(Level.SEVERE, null, ex);
catch (InstantiationException ex)
Logger.getLogger(SomeGUI.class.getName()).log(Level.SEVERE, null, ex);
catch (IllegalAccessException ex)
Logger.getLogger(SomeGUI.class.getName()).log(Level.SEVERE, null, ex);
catch (UnsupportedLookAndFeelException ex)
Logger.getLogger(SomeGUI.class.getName()).log(Level.SEVERE, null, ex);
setTitle("BenkyoAdd");
setSize(206,100);
setResizable(false);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setLocationRelativeTo(null);
setVisible(true);
panel = new JPanel();
getContentPane().add(panel);
panel.setLayout(null);
run = new JButton("Run");
run.setFocusable(false);
run.setBounds(0,0,100,30);
panel.add(run);
run.addActionListener(this);
progress = new JLabel("Please click run");
progress.setFont(new Font("lol",Font.PLAIN,14));
progress.setBounds(10, 30, 200, 50);
panel.add(progress);
exit = new JButton("Exit");
exit.setFocusable(true);
exit.setBounds(100, 0, 100, 30);
panel.add(exit);
exit.addActionListener(this);
chooser = new JFileChooser();
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
public void actionPerformed(ActionEvent e)
if(e.getSource().equals(exit))
System.exit(0);
if(e.getSource().equals(run))
progress.setText("Select a folder...");
chooser.showOpenDialog(panel);
this.returnpath = chooser.getSelectedFile().getAbsolutePath();
exit.setEnabled(false);
run.setEnabled(false);
progress.setText("Copying to output folder...");
new Thread(this).start();
public static void main(String args[])
new SomeGUI();
public void run()
new Changer(this, this.returnpath);
exit.setEnabled(true);
exit.requestFocusInWindow();
progress.setText("Done! You can now exit!");
} -
Running Multiple Same Applications
Hello All. I was really wondering if OSX has the ability to run the same application at the same time. Example would be like Firefox, Safari, World Of War Craft ETC... I know on a PC I can run as many instances of the same app on my PC as I needed and would like to know if this is at all possible on a MAC. Very Much appreciated for any and all intel on this subject. Please Advise...
Brian Postow wrote:
nerowolfe wrote:
If you right-click textedit.app, for example, one of the options is "Show Package Contents"
This is a NEW feature in 10.5.3 IIRC. And a feature that I am very happy with.
It came along with the first version of Leopard, 10.5.0
http://www.appletell.com/apple/comment/show-package-contents-can-now-be-a-simple -keystroke/
Remember that Leopard, like most of an iceberg, is below the surface. Knowing how to use the entirety of Leopard is important for some of us. It's fun and one never stops learning new things.
I'm not disagreeing with any of that. I'm just wondering if there is documentation on opening the actual executable files. open is NOT a standard unix command. I believe it's a mac specific thing, it doesn't exist in BSD based Ultrix, SunOS or any other unix I've used. So Apple CAN decided how it gets used, and what it does, and the documentation would have to be Apple's.
It may be Mac-specific. The man says it was introduced with NextStep.
However, the ancient Unix command 'exec' is nearly identical and if you replace 'open' with 'exec' in my examples, you get the same result
For example:
exec /Applications/TextEdit.app/Contents/MacOS/TextEdit
runs an instance of textedit just as does 'open'
And I still want to know how applescript interacts with this feature. Because you usually just say "tell textedit.app ....." If there are two instances, which one gets the message? and where is this documented?
AppleScript is a different animal. I don't think 'tell' is a BSD item.
Also, my main point above was that your comment of "look at the man page" didn't actually answer my question.
I suggested that as a way of understanding the command, 'open' not a general tutorial on how BSD supports multiple instances of programs internally.
For example, one may not find a document describing exactly a very complex and complicated pipe command, but a good working knowledge of the OS is sufficient to create it. Same with shell programming. There are hundreds of book on dozens of programming languages, Ruby, PHP, built-in, to name a few. And there are dozens of shells. There is no one document to describe all of it.
I go back to Kernighan and Pike and Richie days, when I ran Coherent at home on an old PC and used Unix on mainframe terminals where I was consulting. -
UI problem when run java swing application on MAC OSX
Hello,
I have problem when i run my java swing application on MAC OSX.
Dialog box is not properly visible in MAC means ita size increses.
its size incresed and and some content or buttons on that dialog are not fully visible.
I can only see partial message or button.
If any one have idea about this problem then give the solution.
Thanks :)
ShwetaI am using following way to create dialog
JOptionPane optionpane = new JOptionPane(new Object[]{lblMsgUp}, JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, null, choices, "Save");
JDialog dialog = optionpane.createDialog(parent, "Save");
dialog.setSize(450, 125);
dialog.setVisible(true); -
Slow performance when running non-swing Application?
I created a very simple GUI Application with some buttons. The App is sitting on a UNIX box and I am running it from my local PC. I have Hmmingbird Exceed running. It seems to come up very slowly. I am specifically not using any swing components. Is this normal? Anything I can do to speed it up? Thanks...
Regardless of whther it's a Java or a Hummingbird
issue, I think this is a valid place to ask for help
about this since the odds of there being someone else
here having conquered this same problem would be
rather high.Yep, people have the problem. I have had the problem. I haven't seen anyone that claims a solution.
>
I would also guess that there isn't much of any wayto speed it up.
What I don't understand is why the behavior of the
Java app on the Unix box is quite fast and yet the
redraw on the Exceed clent is excruciating slow. This
effect does seem to be present with our older apps
written in other languages.
Why would Exceed treat a Java app differently than one
written in any other language? I don't get it.
I believe someone at some time suggested it has to do with the way java interacts with the unix environment. But my memory on the subject is very fuzzy and the person explaining might not have known what they were talking about.
Of course I question the wisdom of running a GUIapplication written > in a language that is portable
across platform via a remote access
program in the first place.What is so unwise about it? The customer will run the
app in Unix. I have a PC on my desk. I use exceed to
connect to a Unix box to test behavior in Unix on my
PC. Sounds wiser than walking halfway accross the
company to sit in front of the Unix box.
Testing, of course, should only be done in the environment that will actually be run.
Admittedly I might be overly sensitive to this as I worked on a project where a customer complained about the same thing. Given that the contract did not specify running via hummingbird there was no grounds for complaint. -
Can you run multiple Excel Services Applications against a single Web Application?
I have been struggling with this one for a while now, hopefully someone can help me understand what I am missing...
I have a single SharePoint Farm. This farm runs multiple Web Applications & the Service Applications.
1. SharePoint Only Server with Multiple Site Collections (http://sharepoint.com/...)
2. MS Project Server with Multiple Site Collections (http://pwa.com/...)
3. My services applications all exist on the same farm.
I was under the impression, and believe that I validated this through testing and from this site (http://blogs.office.com/2009/11/16/excel-services-in-sharepoint-2010-administration-improvements),
that you can only run a single Excel Services Application against each unique Web Application. In essence, I can run one Excel Services Application against the SharePoint Only Server, and another Excel Services Application against the MS Project
Server... However, I can NOT run multiple Excel Services Applications against the different Site Collections within the MS Project Server becuase it is only aware of its "default" Excel Service Application.
ie. I can NOT do the following: ExcelServiceApp1 for
http://pwa.com/SiteA & ExcelServiceApp2 for
http://pwa.com/SiteB
Is that correct?
If that is not correct, then I must be missing a way to specify a different Excel Service App for each Project Web App Site.
Some other solutions that I think may work, but would really appreciate if someone could validate:
- Create multiple Project Server Service Applications for each instance of PWA/Excel Service? (but wouldn't this still have to use one of the two WebApplications and cause the same limitation?)
- Create a new Web Applciation for each PWA/Excel Service? (ie.
http://pwasite1.com;
http://pwasite2.com; http://pwasite3.com, etc.)
Thoughts/suggestions are very greatly appreciated!!!Hello Trpy2k
I have not done what you are doing and I assume that you are using project server 2010. However, you answer lives in PowerShell.
The New-WebServiceProxy show that you can create a new proxy by spacing a URL and not a web application. The default proxy from the web application is directing to the default excel service. If you need another excel service, you must specify another
proxy and this may do it for you.
Also, don't forget the Secure State service and that each excel report will need this configured, that is with the assumption that the other excel service requires different authentication.
PS. This question may get a better answer in the SharePoint forums.
Cheers!
Michael Wharton, MVP, MBA, PMP, MCT, MCTS, MCSD, MCSE+I, MCDBA
Website http://www.WhartonComputer.com
Blog http://MyProjectExpert.com contains my field notes and SQL queries -
Run Swing application without opening DOS prompt window
is it possible to run a Swing application without opening a command interface window in MS Windows?
thanksDon't know if you mean that, but if you try to call javaw.exe instead of java.exe there pops no prompt up.
-
Running java swing apps thru telnet... [Is this possible?]
Hi All!
I am just wandering if it is possible to run swing applications thru telnet since everytime I run it... it returns ang error....
Exception in thread "main" java.lang.NoClassDefFoundError: sun/awt/X11GraphicsEnvironment
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java:173)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:90)
at at sun.awt.motif.MToolkit.<clinit>(MToolkit.java:109).null(Unknown Source)
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java:173)
at java.awt.Toolkit$2.run(Toolkit.java:754)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:745)
at javax.swing.ImageIcon.<init>(ImageIcon.java:226)
at javax.swing.LookAndFeel$1.createValue(LookAndFeel.java:295)
at javax.swing.UIDefaults.getFromHashtable(UIDefaults.java:203)
at javax.swing.UIDefaults.get(UIDefaults.java:148)
at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:65)
at javax.swing.UIDefaults.getIcon(UIDefaults.java:429)
at javax.swing.UIManager.getIcon(UIManager.java:562)
at javax.swing.plaf.basic.BasicOptionPaneUI.getIconForType(BasicOptionPaneUI.java:600)
at javax.swing.plaf.basic.BasicOptionPaneUI.getIcon(BasicOptionPaneUI.java:586)
at javax.swing.plaf.basic.BasicOptionPaneUI.createMessageArea(BasicOptionPaneUI.java:337)
at javax.swing.plaf.basic.BasicOptionPaneUI.installComponents(BasicOptionPaneUI.java:178)
at javax.swing.plaf.basic.BasicOptionPaneUI.installUI(BasicOptionPaneUI.java:146)
at javax.swing.JComponent.setUI(JComponent.java:475)
at javax.swing.JOptionPane.setUI(JOptionPane.java:1725)
at javax.swing.JOptionPane.updateUI(JOptionPane.java:1747)
at javax.swing.JOptionPane.<init>(JOptionPane.java:1710)
at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:832)
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:646)
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:617)
at JTest.main(JTest.java:40)
Source Code:
import javax.swing.*;
import java.awt.*;
public class JTest extends JFrame{
JPanel pnlMain = new JPanel();
JLabel lblMsg=new JLabel("This is only a test.");
Font font=new Font("Arial", Font.BOLD, 28);
public JTest(){
try{
this.setTitle("Unix Frame Testing");
this.setBounds(10,10,500,100);
this.setVisible(true);
this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
lblMsg.setFont(font);
lblMsg.setBounds(100,10,250,50);
pnlMain.setLayout(null);
pnlMain.add(lblMsg);
this.setContentPane(pnlMain);
}catch(Exception e)
{ System.out.println("Unable to Display Window.");
JOptionPane.showMessageDialog(null,"Unable to Display Window.","Error",JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
public static void main(String args[]){
JTest test=new JTest();
}"scripts" are entirely different from GUI applications. What do you expect to happen when you run a Swing application through telnet on another machine? Do you expect the Swing UI to be magically transported to the local Windows machine?
Not gonna happen. Yes, like ejp hinted, you could run an X-environment on your local machine and have the Swing UI tunnel its output there, but are you sure you want GUI apps to run on a remote machine like that? It's not gonna be fun to work with, I'll tell you that.
Why not create a Java WebStart app (or perhaps even an applet) out of your application, so your users can run the application locally? -
Make a seprate swing application
I am running a swing application that is having toolbars with different buttons. In the buttons I am having a record button that is opening a recording window. When I click on the quit button of toolbar the toolbar along with the recording window is closing. My requirement is not to close the recording window when I quit from the toolbar.
How to start seprate process from the java application. If I quit the one should not close the other process.Please reply imm:
Assume we have 2 applications 1) App name IW 2) App name is RP
IW geneartes a toolbar which contains some buttons.
Here I can get output of RP by running itself or from a button of a toolbar which generated by running IW app.
Now here is my requirement which should follow below 3 points :
At any time I should have only single output for RP app. i.e,
1) If I run RP app , then next i clicked RP source button in toolbar of IW,
then i should get any more output of RP since it is already running( already RP output exist / at a time single instance for RP).
2) If I run IW app, then toolbar generated .Now I clicked on RP source button.I got the output of RP app by running RP app with Runtime class.
If I click one more time on RP source button , I should not get one more output for RP app, at any time I should have only single instance for RP.
I can get RP output if and only if I dont have any output of RP app on desktop.
3) If RP app run from IW , then If I try to run RP independently I should not get any more instance output for RP.
Thanks
rams -
When I run a swing application inside JDeveloper, if an exception is thrown, I see a log in Jdeveloper in 'Running' window.
Is there such log for the swing application deployed using webstart (somewhere on the client machine)?Hi,
see http://www.lecture123.com/elearning/jws-log.html
Frank -
Probl launch multiple swing app in the same vm
Hello,
I lauch multiple swing applications in the same vm ; my problem is that applications launched are not isolated :
shared look and feel
only one modal dialog box can be shown
is there a way to isolate applications ?
thanks.it make some work,but if you rename instances(or and classes) for the second appl. the second application doesnt know the first application
not fine,but me work. -
TAB key isn't available in swing applications on Linux
Hello,
I have a small Swing application, everything works fine except that TAB key isn't available within java
application. I tried several JVM (IBM and Sun JVM from 1.2.2 to 1.4.0_b92) and two Red Hat release (6.2 and 7.2), I had no success with TAB key. The same application works perfectly on Windows for example. Can this problem have something to do with a bad Xmodmap file? I tried with a standard Xmodmap file (/usr/X11R6/lib/X11/etc/xmodmap.std), but TAB key was still unavailable. On non-java application, TAB key is available normally.
Any suggestion would be appreciated.
Thanks in advance.Do you mean that
(1) when you are running a swing application and you press the tab key expecting focus traversal, nothing happens?
OR
(2) when you are listening for KeyEvent within your application, tab key doesn't give you KeyEvent.VK_TAB?
OR
(3) something else?
I have no Linux but would try to offer suggestions if I understood better. -
Executing multiple apex applications from EBS
Hi,
We have developed an apex application which can be triggered through an application link from Oracle EBS. Now, we have a requirement to run multiple apex applications from a single EBS session simultaneously.
Can someone provide information on how this can be acheived?
Raajkumar GHi,
We have developed an apex application which can be triggered through an application link from Oracle EBS. Now, we have a requirement to run multiple apex applications from a single EBS session simultaneously.
Can someone provide information on how this can be acheived?
Raajkumar G -
Running a Java application from a Swing GUI
Hi,
I was wondering if there is a simple way to run a Java application from a GUI built with Swing. I would presume there would be, because the Swing GUI is a Java application itself, technically.
So, I want a user to click a button on my GUI, and then have another Java application, which is in the same package with the same classpaths and stuff, run.
Is there a simple way to do this? Do any tutorials exist on this? If someone could give me any advice, or even a simple "yes this is possible, and it is simple" or "this is possible, but difficult" or "no this is not possible" answer, I would appreciate it. If anyone needs more information, I'll be happy to provide it.
Thanks,
DanI don't know if it is possible to run the main method from another Java app by simply calling it...
But you could just copy and paste the stuff from your main method into a new static method called something like runDBQuery and have all the execution run from there.
How does that sound? Is it possible?
What I'm suggeting is:
Original
public class DBQuery{
public static void methodA(){
public static void doQuery(){
methodA();
public static void main(String[] args){
// Your method calls
//Your initializing
doQuery();
}Revised:
public class DBQuery{
public static void methodA(){
public static void doQuery(){
methodA();
public static void doMyQuery(){
// Your method calls
//Your initializing
doQuery();
// No main needed!!
//public static void main(String[] args){
// Your method calls
//doQuery();
//} -
Using tesing, i can't run any swing java application.
Any swing application, ex. xxe or openproj.
Using openjdk6, i got those error:
env:
[hubert@hubert-dell bin]$ java -version
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.5pre-r059f6ba0c7dd) (ArchLinux-1.5_hg20090429-1-x86_64)
OpenJDK 64-Bit Server VM (build 14.0-b10, mixed mode)
error:
[hubert@hubert-dell bin]$ ./xxe
internal error: cannot create application: java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-1.6.0-openjdk/jre/lib/amd64/motif21/libmawt.so
+---------------------------------------
| java.lang.ClassLoader.loadLibrary(ClassLoader.java:1666)
| java.lang.Runtime.load0(Runtime.java:787)
| java.lang.System.load(System.java:1022)
| java.lang.ClassLoader$NativeLibrary.load(Native Method)
| java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1767)
| java.lang.ClassLoader.loadLibrary(ClassLoader.java:1684)
| java.lang.Runtime.loadLibrary0(Runtime.java:840)
| java.lang.System.loadLibrary(System.java:1047)
| sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:67)
| sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:47)
| java.security.AccessController.doPrivileged(Native Method)
| java.awt.Toolkit.loadLibraries(Toolkit.java:1610)
| java.awt.Toolkit.<clinit>(Toolkit.java:1632)
| java.awt.Color.<clinit>(Color.java:279)
| javax.swing.plaf.metal.MetalTheme.<clinit>(MetalTheme.java:76)
| javax.swing.plaf.metal.MetalLookAndFeel.getCurrentTheme(MetalLookAndFeel.java:1681)
| javax.swing.plaf.metal.MetalLookAndFeel.createDefaultTheme(MetalLookAndFeel.java:1576)
| javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1598)
| javax.swing.UIManager.setLookAndFeel(UIManager.java:545)
| javax.swing.UIManager.setLookAndFeel(UIManager.java:585)
+---------------------------------------
then i change java-runtime to sun java sdk.
env:
[hubert@hubert-dell bin]$ java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02, mixed mode)
[hubert@hubert-dell bin]$
error:
[hubert@hubert-dell bin]$ ./xxe
# An unexpected error has been detected by Java Runtime Environment:
# SIGSEGV (0xb) at pc=0x00007f02743bb438, pid=16636, tid=139648504359248
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.3-b02 mixed mode linux-amd64)
# Problematic frame:
# C [libc.so.6+0x30438] catgets+0x18
# An error report file with more information is saved as:
# /tmp/hs_err_pid16636.log
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
./xxe: line 40: 16636 已放弃 java $mem $opt -DXXE_GUI="$XXE_GUI" -DXXE_ADDON_PATH="$XXE_ADDON_PATH" -DXXE_USER_PREFERENCES="$XXE_USER_PREFERENCES" -classpath "$cp" com.xmlmind.xmleditapp.start.Start "$@"
[hubert@hubert-dell bin]$
My archlinux:
[hubert@hubert-dell ~]$ uname -a
Linux hubert-dell 2.6.29-ARCH #1 SMP PREEMPT Wed Apr 29 15:36:46 CEST 2009 x86_64 Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz GenuineIntel GNU/Linux
[hubert@hubert-dell ~]$ yaourt -Q glibc openjdk6 kernel26
==> List all installed packages
local/glibc 2.9-7
local/openjdk6 1.5_hg20090429-1
local/kernel26 2.6.29.2-1
[hubert@hubert-dell ~]$
Last edited by hubertstar (2009-04-30 17:15:28)ok, this's not a bug.
I'm install eioffice(Yongzhong office, a chinese office software) and test it, and i have to set AWT_TOOLKIT=MToolkit (Running eio with compiz).
That's the problem.
unset AWT_TOOLKIT
no errors.
Maybe you are looking for
-
Different max photo sizes in emails, beams, photo stream?
I've noticed differences in file sizes when emailing photos from the iPhoto app, when inserting in an email, and when emailing directly from the photo. I've found that iOS 6 is able to send the largest file when inserting it into an email. If I sele
-
Hi Gurus, I have one GL a/c which s a balance sheet ac and I made postings to this GL ac.Now I want to activate Openitem Management functionality on this a/c. While changing this GL a/c to put OpenitemManagement check,it is not allowing me to save.It
-
SET_FIXED_TABLE_LAYOUT Fail in google chrome
hi: I created a ALV list in web dynpro for abap application.I used a method which name 'SET_FIXED_TABLE_LAYOUT'. this application is Success in ie8 , but it's fail in google chrome in ie8 in google chrome code DATA lo_nd TYPE REF TO i
-
This is my first time at dataguard. I've laid all the pipework and trying to perform duplicate target database for standby dorecover. I have ASM configured on both nodes. I have the backup location mounted on nodes. I am getting this error and wonder
-
Hi, Due to new busines requirements, I have to comment couple of tables in the query object. When I start compiling after commenting out the conditions and tables, it starts throwing errors BAD BIND VARIABLE xxx NOT DEFINED. Report has automatically