Created
August 26, 2015 20:59
-
-
Save shannah/c03f22a85cf382b552b0 to your computer and use it in GitHub Desktop.
Flickr Concentration Step 1: Setting up basic forms of the app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.codename1.demos.flickrconcentration; | |
import com.codename1.ui.Form; | |
import com.codename1.ui.plaf.UIManager; | |
import com.codename1.ui.util.Resources; | |
import java.io.IOException; | |
public class ClassicFlickrConcentration { | |
private Resources theme; | |
public void init(Object context) { | |
try { | |
theme = Resources.openLayered("/theme"); | |
UIManager.getInstance().setThemeProps(theme.getTheme(theme.getThemeResourceNames()[0])); | |
} catch(IOException e){ | |
e.printStackTrace(); | |
} | |
} | |
public void start() { | |
newGameForm(); | |
} | |
/** | |
* The entry form for the app. Allows user to enter a search for flickr images. | |
*/ | |
public void newGameForm() { | |
Form f = new Form("New Game"); | |
// Create a form with a Span label with some instructions, a text | |
// field to enter a flickr search term, and a button. | |
// Use BoxLayout on the Y-Axis for the layout | |
// When you click the button is should navigate to the game board | |
// by calling showBoard() | |
f.show(); | |
} | |
public void showBoard() { | |
Form f = new Form("Game Board"); | |
// Show a form that will eventually contain our game board. | |
// Form uses BorderLayout. Center panel will have a container | |
// that uses GridLayout, and the south will have a button to | |
// go back to the new game form. | |
f.show(); | |
} | |
public void stop() { | |
} | |
public void destroy() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment