|
-
repainting the whole frame??
I have a JOptionPane that pops up and asks the user to enter a filename.
i need help with Two questions:
1) my JOptionPane:
String inputValue = JOptionPane.showInputDialog("Please input fileame (including extension)");
filename = inputValue;
passes the entered filename to my global variable "filename". This variable (filename) is used to paint the image onto a JIcon:
ImageIcon icon = new ImageIcon(filename);
JLabel background = new JLabel(icon);
mapPanel.add(background);
What do i need to do to get the loaded image update? Ithough i would just be able to do a :
mapPanel.repaint()
but it doesnt work because it only ever calls the:
this.getContentPane().add(mapPanel, BorderLayout.CENTER);
once. So how do i get it to repaint the whole frame again? this time including the newly updated filename???
2)What do i need to do to add browse functionality to the JOptionPane???
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks