Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Two in one...  RSS feed

 
Dave Jones
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I'm writing a GUI and I've encounterd two simple problems and can't find the simple answers... well, here goes:
1.
I would like to make my windows resizeable(so the users will be able to enlarge the window if they want) and I would like to lock the window size-so the users won't be able to resize it.

2.
Iwant to ust a text mask, for example: IP numbers- 123.234.12.34 .here the user only enters the numbers and the dots are added (or just there to beggin with).How do I do this?

Thank you
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>1.
>I would like to make my windows resizeable(so the users will be able to
>enlarge the window if they want) and I would like to lock the window size-so
>the users won't be able to resize it.

frame.setResizable(false);//default is (true)


>2.
>Iwant to ust a text mask, for example: IP numbers- 123.234.12.34 .here the
>user only enters the numbers and the dots are added (or just there to beggin
>with).How do I do this?

MaskFormatter mf;
try{mf = new MaskFormatter("###.###.##.##");}
catch(Exception e){e.printStackTrace();}
JFormattedTextField ftf = new JFormattedTextField(mf);
 
Dave Jones
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, but I should have said that I'm using SWT so 'Frame' is not possible
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!