Scrolling functionality in Blackberry - java

I have 4 buttons 1)left 2)video 3)technical insight 4)right..as seen in the below image.Now I want to provide functionlity to this image.The functionality is
If i click on the left arrow the video technical insight have to scroll to the left and similarly if I click on the right arrow the the two buttons have to scroll to the right and show two more video names..in Blackberry Simulator
Can anyone please help me in writing the code.I would be happy If I can get the code to provide this functionality in Blackberry..
I have some ideas regarding this.Do tell me if this can be done or not..
I created left button ,videos button,technicalinsight button and right button in a manager called hfm
When i click on the left button the entire things in hfm will get deleted using hfm.deleteAll() and then repaint it with the hfm which we get after scroll.
Is this idea good or any better approach for this??

you can Override the paint() method and use graphics.drawBitmap to redraw the screen.

Related

Adding a 'Minimize' button to JTabbedPane Tab Bar

I've searched extensively to solutions for this but haven't found anything that really achieves what I'm trying to do, the closest thing I could find was the solution posted at the bottom of this thread: http://www.java-forums.org/awt-swing/12267-how-add-jbutton-tabbed-pane-headder.html .
However because the JTabbedPane I'm using is inside a JSplitPane, it's size can increase/decrease, so using that solution doesn't work as the button stays static.
Below is an image of where I would like the place the component, similar to how eclipse has a minimize button on it's pop out views.
Is this possible without creating a custom JTabbedPane component?
Do you really need this button to hide?
Why don't you set splitpane.setOneTouchExpandable(true);?
With this line you can hide the bottom with an arrow of the splitpane.

Android: Unexpectedly Quit When Trying to Switch Activity

I'm new to posting, but have been using the site for help for a while now. So thanks for that!
I'm working on a new app, got everything running well. It's a kids' soundboard. 2 pages of imagebuttons in a relative layout, with onclick listeners which triggers SoundPool.
My question is this:
in testing I've discovered if you're finger is anywhere on the screen where a button is not (say pressing on the background) and then you try to touch a button (multitouch) ... the button press doesn't register. Any way to fix this?
Thanks!
You have to cover additional event types for multi-touch, if you are not covering below Actions, you are not covering multi-touch
MotionEvent.ACTION_POINTER_DOWN: This event happens for any additional finger that
touches the screen after the first finger touches
MotionEvent.ACTION_POINTER_UP:This gets
fired when a finger is lifted up from the screen and more than one finger is touching
the screen.
The explanation is quite tedious. I suggest you to google multi-touch for android. One helpful link is: http://android-developers.blogspot.in/2010/06/making-sense-of-multitouch.html

Rectangular Java Swing Radio buttons?

I'd like to create a set of buttons in a Java Swing application like you get in a typical tool palette in a paint program. That is, a set of small square buttons, each containing an icon, only one of which is pressed down, and when you press another button, the first is deselected. I've thought of a number of solutions and none of them seem very easy/elegant.
This sounds like a job for JRadioButton, but if you add an Icon to that, you still get the small circle, which is fairly space inefficient. I guess an option would be finding an alternative Look and Feel or painting code for JRadioButton.
Another alternative might be to add JButton to a ButtonGroup, maybe setting a JToggleButton.ToggleButtonModel as the model, but that doesn't have the desired effect, as the painting code for a standard JButton does not keep it depressed when selected. Possibly the JButton code could be modified to do this. Like making it painting "selected" the same way as "pressed".
A third alternative would be to use normal JButton's, and add a common mouse listener that keeps them pressed or not, and communicates the changes between the buttons.
Can anyone advise on the best way to achieve the aim please? A simple method I've missed would be best, but advice on which of these three alternatives would be best and pointers on how to get started would be useful too.
What about a plain JToggleButton in a ButtonGroup? It is not abstract, you can instantiate one with an Icon, and it stays depressed while selected.
See the SwingSet2 demo:
http://java.sun.com/products/plugin/1.4/demos/jfc/SwingSet2/SwingSet2.html
Click the second icon on the toolbar (the one twith the check box and radio button) then tab "Radio buttons". Then click on "Paint Border" on the right panel, under "Display Options".
Source code of the demo is under your JDK install dir, so for example on my PC it's under \jdk1.6.0_01\demo\jfc\SwingSet2\src

What in Android would allow me to touch the edge of my screen while playing my game and slide over an Item screen?

Android has many useful tools when coming to views and screens and layouts.
Description: While playing my game (running around as a zombie bear eating humans) I would like to allow the player to access an items menu via sliding a menu from the right side/edge of the screen. Or at the least be able to access a game options menu (not game settings which would be the menu button).
What would be the best fit for description?
P.S How would I make a question like this less like a discussion and more like a straight forward programming question when I don't really know what's available to do this.
Also, if this is the case, please point me to another location to ask a question that may require a discussion.
Thank You!
Try looking at the SlidingDrawer class.
PS I personally don't see a problem with how you have worded your question if you are looking for ideas of views/widgets you need to perform a specific function/effect.
My first thought, and for a simple approach (this wouldn't be animated or dragged really), would be using a RelativeLayout where the portion representing the menu was initially set so that it's visibility were GONE, except for a small tab or arrow or something. When that tab/arrow is touched, the visibility of the View for the menu could be toggled to VISIBLE.
With visibility set to GONE, a view is not drawn or considered in any part of the layout pass when the screen is drawn.
You could populate a listview with some icons and when an particular icon is selected, then figure out which one was selected and then execute some function and hide the sidebar using an animation. I've never developed a game, so I'm not too sure how far it deviates from the standard, but I wish you the best of luck :) ! If you post the source let me know would love to test your game and see how you work with the source!

Java: Creating a scrolling submenu

I have a program in which I have a large amount of items listed under a specific submenu. I am looking for a way to scroll through them, as the menu is now larger then the screen. Previously i have seen menus in which the top and bottom icons are arrows which, when the mouse hovers over, scroll up or down respectively. Can someone please explain to me how to do this? Or else simply how to add a scrollbar to my submenu?
Thanks!
Another option might be Darryl's Menu Scroller.

Categories

Resources