Originally posted by Dave Donohoe:
Hi all - can anyone tell me the easiest way to add a Right Click Popup Menu onto the items in a JList?
Originally posted by wasif akbar:
The application I working on allows you to parse thru xml files. It looks for certain tags within the xmls and then writes out the value for the "Name" attribute of that tag to a file. On my gui, I have a textfield, a textarea and two buttons, one button to browse for the xml file and one called parse. When I parse, all of objects that I am parsing for get written to a file that is created. Basically what I want is for the user to be able view the contents of the file as it is being generated or as soon as it is generated in the textarea on my gui. What I don't want to do is create another button called "View File" and then when you click on it, the file gets opened in the textarea. I want the contents to be displayed in the textarea as soon as the file has been parsed or while it is being parsed.
Any help would be great. Sample code would be even better. The gui is mostly awt components except for the filechooser when I browse.
Originally posted by tom tran:
I am writing a Java app (thick app) and I'd like to send
files to a web server using HTTP protocol. If you know how
to do it, I would very much appreciate if you can tell me.
I already have an example of sending files using ftp but
what I want to use is HTTP since the requirement of communication
Thanks in advance,
Originally posted by Andrew Hoffman:
I can run this as an applet but not as an application. Can someone help make this program do either or?
public class Lab14_1 extends JApplet implements ActionListener
// Delcare Audio Files
static AudioClip playAudio;
protected AudioClip loopAudio;
protected AudioClip stopAudio;
// Declare Buttons
private JButton jplay = new JButton("PLAY");
private JButton jloop = new JButton("LOOP");
private JButton jstop = new JButton("STOP");
private boolean isStandalone = false;
public static void main(String  args)
// Create a frame
MyFrameWithExitHandling frame = new MyFrameWithExitHandling(
// Crate an instance of the applet
Lab14_1 applet = new Lab14_1();
applet.isStandalone = true;
// Add the applet instance to the frame
// Invoke init() and start()
// Display the frame
public void init()
JPanel p = new JPanel();
// Create audio clips for playAudio, loopAudio
playAudio = getAudioClip(getCodeBase(),
loopAudio = getAudioClip(getCodeBase(),
// Register Listeners
public void actionPerformed(ActionEvent e)
if (e.getSource() == jplay)
if (e.getSource() == jloop)
if (e.getSource() == jstop)
Originally posted by anukampa malhi:
you are correct that i shd u use JTextPane but i m not able to get how can i actually use it. I have spend almost 3 days to work thru JTextPane but of no use. Can u please help me in same.
Originally posted by Felix Devasia:
Can anyone tell me how I could get rid of the default titlebar of the frame while running swing applications? Also, can I change the default icin of the "teacup", in the upperleft corner of the titlebar?
Originally posted by Sergei Voropay:
I'm working on an applet derived from JApplet class. When running the applet in browser and scrolling the page in any direction, the applet flickers. Is there a way of getting rid of this annoying behavior?
Originally posted by James Lechte:
im trying to extend basic design of a console based system to a gui interface. I am having a problem with an array within an 'Account' class which stores details and amounts of accounts. The problem is: when i try and tie up the class which builds up the interface, panels, panes, container etc. to the 'Account' class it cannot pass the info properly. I have looked at numerous examples of swing and AWT but cannot see examples of pluggin in other classes!
please any advice would help!
Originally posted by Skantha Kandiah:
I am trying to create an application that can display different images in a single frame. The main frame contains a JScrollPane that contains a JPanel. Initally there is no image on the JPanel and there are no scrollbars on the scroll pane. When I add a large image to the JPanel the scrollbars don't appear on the scroll pane. What function do I need to call for the scroll bars to appear? I tried revalidate() and it did not work.
Originally posted by rajesh purohit:
We have vertical and horizontal AWT scroll bars in out applet. We are trying to capture the mouse clicked and released events on that component. But the component generates only pressed, entered and exited events. But the right mouse button generates clicked and released events (weird!!). Is there any way to fix this sothat the left mouse button generates the clicked and released events?
Any help would be appreciated.