开发者

Writing number keypad

开发者 https://www.devze.com 2022-12-10 23:00 出处:网络
I am writing a program that prints out telephone numbers that are to be entered by users. On the west side, I need a picture icon of 3 peopl开发者_JS百科e. In the center, I need the keypads. On the No

I am writing a program that prints out telephone numbers that are to be entered by users. On the west side, I need a picture icon of 3 peopl开发者_JS百科e. In the center, I need the keypads. On the North side, I need the numbers to be displayed. Can someone help with the layout of the buttons?


There is a class for the numberpad in opensubsystems, if you don't want to do it yourself:

http://www.opensubsystems.org/docs/patterns/code/org/opensubsystems/patterns/thickclient/application/swt/NumberPad.html

However, this sounds like a class assignment, so you may need to do it from scratch.

You might find some pointers with this Google search.


I second the comment about your requirements being somewhat unclear. That said, it sounds like you could benefit from a built-in Java layout manager. Check out the BorderLayout for the overall page design. That webpage also has links to other managers you might find useful, such as GridLayout for the numpad.


Use a GridLayout on a panel to create the keypad itself. Use a GridLayout on a panel to place three pictures one on top of the other.

Use the BorderLayout on the frame itself and add the keypad panel to the CENTER, the picture panel to the WEST and the control (JLabel or JTextArea?) to the North. That should look reasonably well. If you need more control you can use more complex layout managers.


What is your question exactly? If i do this, i will use GridLayout for buttons (which enclosed in a panel component) and add it to BorderLayout.CENTER.

I created a mockup app: http://users.hanzo.hu/~hron/soverflow/keypad/keypadapp.png , do you think similar to this?

0

精彩评论

暂无评论...
验证码 换一张
取 消