Results 1 to 12 of 12
Thread: [SOLVED] Resizable applet
- 10-28-2008, 01:34 PM #1
Member
- Join Date
- Oct 2008
- Location
- Lisbon, Portugal
- Posts
- 14
- Rep Power
- 0
[SOLVED] Resizable applet
Hi all, I'm new here and this is my 1st post. Hope you can help me, and I'll do the same if I can...
I was wondering why JApplet's don't have the method setResizable(boolean)?
I want to make it setResizable(false)... Anyone can tell me why I can't do it?
My 1st applet project so.. :)
Thanks
c0elh0
- 10-28-2008, 02:06 PM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Can you show your code, to see what you have done.
- 10-28-2008, 02:18 PM #3
Are you talking about changing the size (WIDTH & HEIGHT in the <APPLET tag) in the HTML that the applet is being displayed in?
I'm not sure you can do that without recreating the HTML with the new values. Or at least you couldn't a couple of years ago.
- 10-28-2008, 02:21 PM #4
Member
- Join Date
- Oct 2008
- Location
- Lisbon, Portugal
- Posts
- 14
- Rep Power
- 0
I have this code for this JApplet.
The problem is, I can't see any method like this.setResizable(false).Java Code:this. getContentPane().setLayout(new BorderLayout()); areaScreen.setEditable(false); areaScreen.setFont(new Font("", Font.BOLD, 60)); areaScreen.setForeground(Color.DARK_GRAY); areaScreen.setText("eTraveler Demonstrator"); areaScreen.setBackground(Color.BLACK); upperPanel.setLayout(new BorderLayout()); upperPanel.add(areaScreen,BorderLayout.CENTER); upperPanel.setBackground(Color.BLACK); BtnNext.setText("Biographic Data"); BtnNext.addActionListener(this); BtnPrevious.setText("Back"); BtnPrevious.addActionListener(this); BtnPrevious.setVisible(false); BtnAction.setText("Capture"); BtnAction.addActionListener(this); BtnAction.setVisible(false); BtnClose.setText("Close"); BtnClose.addActionListener(this); BtnClose.setVisible(true); midPanel.setLayout(new BorderLayout()); midPanel.setBackground(Color.BLACK); lowerPanel.setBackground(Color.BLACK); lowerPanel.add(BtnPrevious); lowerPanel.add(BtnAction); lowerPanel.add(BtnNext); lowerPanel.add(BtnClose); getContentPane().add(upperPanel,BorderLayout.NORTH); getContentPane().add(midPanel,BorderLayout.CENTER); getContentPane().add(lowerPanel,BorderLayout.SOUTH); Dimension scSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension aux = new Dimension(scSize.width,scSize.height-110); this.setSize(aux); this.getContentPane().setVisible(true);
Is that a feature of Applet's??
- 10-28-2008, 02:24 PM #5
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
I think he is talking about the applet viewer. Actually on the applet viewer too, you cannot do that. But you can change the size, width and height.
- 10-28-2008, 02:25 PM #6
Member
- Join Date
- Oct 2008
- Location
- Lisbon, Portugal
- Posts
- 14
- Rep Power
- 0
Like JFrame has a method setResizable(boolean), I was thinking that applet could have the same method...
- 10-28-2008, 02:25 PM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 10-28-2008, 02:26 PM #8
Member
- Join Date
- Oct 2008
- Location
- Lisbon, Portugal
- Posts
- 14
- Rep Power
- 0
Do you know why that can't be done? just to know... I'll try to find another solution to my situation.
Thanks
- 10-28-2008, 02:27 PM #9
Member
- Join Date
- Oct 2008
- Location
- Lisbon, Portugal
- Posts
- 14
- Rep Power
- 0
yes, that's it
- 10-28-2008, 02:32 PM #10
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Reason is, applets are embedded with HTML pages. Once you define the size of the applet you cannot change anyway. Basically it's all about Encapsulation, no need to allow unwanted methods for users.
- 10-28-2008, 02:33 PM #11
Member
- Join Date
- Oct 2008
- Location
- Lisbon, Portugal
- Posts
- 14
- Rep Power
- 0
I get it, in fact it's very logical.
Thanks a lot.
- 10-28-2008, 02:35 PM #12
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Similar Threads
-
Not-resizable (J)dialog showing Maximize Menu !!!
By playwin2 in forum AWT / SwingReplies: 7Last Post: 09-08-2008, 12:51 AM -
Applet in a GUI
By serfster in forum New To JavaReplies: 1Last Post: 06-12-2008, 11:09 PM -
applet
By amith in forum AWT / SwingReplies: 1Last Post: 05-16-2008, 03:24 AM -
First Applet HELP????
By nvidia in forum New To JavaReplies: 0Last Post: 08-13-2007, 10:11 PM -
Applet, To center text and To open I engage in a dialog in an Applet
By Marcus in forum Java AppletsReplies: 4Last Post: 06-08-2007, 06:15 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks