J2ME Form Nesneleri Melih Sakarya. Form Nesnesi Form form= new Form("Giris"); display.setCurrent(form);

Slides:



Advertisements
Similar presentations
UID – Swing and Graphics Chris Coleman
Advertisements

Chapter 13 Graphics.
COMP 110: Introduction to Programming Tyler Johnson Apr 20, 2009 MWF 11:00AM-12:15PM Sitterson 014.
Custom Painting Gestione della Grafica customizzata Vedi anche:
1 Applets Programming Enabling Application Delivery Via the Web.
Applets and Graphics.
MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee.
Engr 691 Special Topics in Engineering Science Software Architecture Spring Semester 2004 Lecture Notes.
Chapter 15 Graphics. To paint, you need to specify where to paint. Each component has its own coordinate system with the origin (0, 0) at the upper-left.
Copyright 2010 by Pearson Education Building Java Programs More Graphics reading: Supplement 3G.
Objectives The objectives of this chapter are: To discuss the classes present in the java.awt package To understand the inheritance hierarchy of the AWT.
Copyright 2006 by Pearson Education 1 Building Java Programs Supplement 3G: Graphics.
2D Graphics Drawing Things. Graphics In your GUI, you might want to draw graphics E.g. draw lines, circles, shapes, draw strings etc The Graphics class.
Fun with Swing Chapter 9. Overview Swing vs. AWT Creating windows and panels. Displaying formatted text in panels. Drawing graphics (lines, circles, etc.)
J2ME Melih Sakarya Java Teknolojileri Derneği. JVM JAVA Kullanılan yerler  Windows-Linux-Unix-Solaris  PDA lar  Smart Cardlar  Cep Telefonları  Appletler.
Made with love, by Zachary Langley Applets The Graphics Presentation.
Java 2D Training. Basic Tools Java SDK 1.4x Wireless Toolkit 2.x NetBeans IDE + mobility pack Global Code editor Text Comparer Tools Graphics Editor Sprite.
Bottoms Up Factoring. Start with the X-box 3-9 Product Sum
Computer Science 209 Images and GUIs. Working with Java Colors The class java.awt.Color includes constants, such as Color.red, for some commonly used.
Web Design & Development Lecture 19. Java Graphics 2.
1 More on Applets Overview l Changing Colors l Changing Fonts & Styles l Applet Life-Cycle l Input using Dialog Window l Input using HTML parameters l.
Lecture 2 Internet Computing Using Java Theophano Mitsa UMASS-Dartmouth.
CSE 1341 Honors Professor Mark Fontenot Southern Methodist University Note Set 21.
Web Teknologi 3 (MKB721C) Minggu 10 Page 1 MINGGU 10 Web Teknologi 3 (MKB721C) Pokok Bahasan: –Programming a Custom User Interface Tujuan Instruksional.
BA1 MIDP GUI BA2 Displayable hierarki Displayable ScreenCanvas TextBoxAlertFormList GameCanvas.
MIDP GUI Displayable hierarki Displayable ScreenCanvas TextBoxAlertFormList GameCanvas JEM1/jrt.
Java Applets:. How Applets differ from application?: They do not use main method but init(), start() and paint() methods of the applet class They can.
AWT Components. 2 Using AWT Components 4 Component –Canvas –Scrollbar –Button –Checkbox –Label –List –Choice –TextComponent –TextArea –TextField 4 Component.
Review of Math Class Methods abssqrt minmax powround ceilfloor.
Laboratory Study II October, Java Programming Assignment  Write a program to calculate and output the distance traveled by a car on a tank of.
Graphics You draw on a Graphics object The Graphics object cannot directly be created by your code, instead one is generated when the method paintComponent.
Graphics Chapter 16.  If you want to draw shapes such as a bar chart, a clock, or a stop sign, how do you do it?
Cosc 5/4730 Blackberry Drawing. Screen size With Blackberry devices, they have a known screen size in pixels. If you are programming for specific device.
Graphics Programming. Introduction GOAL: Build the Indexer Client Event-driven vs. Sequential programs Terminology – Top-level windows are called “frame.
PreAP Computer Science Quiz
LAB SESSION 7 Graphical user interface Applet fundamentals Methods in applets Execution of an applet Graphics class.
Graphics CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
Department of Computer Science & Engineering
1 Lesson 5. 2 R3 R1 R5 R4 R6 R2 B B A A
J2ME Screen Hierarchy Displayable ScreenCanvas FormAlertListTextbox.
1 Drawing C Sc 335 Object-Oriented Programming and Design Rick Mercer.
Applets Graphical Java programs Run inside web browser Platform-neutral Easy deployment--loads when needed Secure.
Multithreading : animation. slide 5.2 Animation Animation shows different objects moving or changing as time progresses. Thread programming is useful.
Pengantar Teknologi Mobile 12
Cosc 4755 Low-level GUI APIs. Low-Level API Composed of Canvas and Graphics classes – GameCanvas will be covered later on Canvas is an abstract class,
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Topics  Applets  Classes used for graphics Graphics Point Dimension.
Developing J2ME Applications Mobile and Wireless Networks.
26-Jun-15 Applets. 2 An applet is a Panel that allows interaction with a Java program A applet is typically embedded in a Web page and can be run from.
Detecting Changes  ItemStateListener interface – detect changes in internal state of an Item  new selection made in a ChoiceGroup  adjusted value of.
Fonts And Image. Fonts To display text, we choose a font. Recall that we are dealing with pixels in graphics programming. To choose a font, we need to.
Graphics. Graphics Features in Java Topics to be covered Topics to be covered Graphics Basics Graphics Basics Coordinate System Coordinate System Graphics,
J2ME: M3G/11 Intro to J2ME. Prog. v Objectives: –to introduce M3G; –to start talking about "M3G Chapter 2. An Animated Model" u leave the floor,
CIS 068 Welcome to CIS 083 ! Introduction to GUIs: JAVA Swing.
CSE 219 Computer Science III Images. HW1 Has been posted on Blackboard Making a Game of Life with limited options.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 12 lcdui Rob Pooley
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 13 lcdui and OXO Rob Pooley
// Java0601.java // This program demonstrates that the methods of a class are not always // accessible, like they were with the class. In this case an.
MT311 Java Application Development and Programming Languages Li Tak Sing ( 李德成 )
Canvas and Graphics CS 21a. 9/26/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved L17: Canvas.
1 Applets and Course Evaluation Applet Example - Sailing Applet UML Diagrams Applet Web Page Encoding (HTML) Applet Java Coding – Hello World Course Evaluation.
Lecture 8.3 The Use of JComponent. © 2006 Pearson Addison-Wesley. All rights reserved More About the Standard Drawing Classes java.awt.Container.
User Interface Summary Displayable ScreenCanvas FormAlertListTextbox Item DateFieldImageItemTextFieldStringItemGaugeChoiceGroup.
CSI 3125, Preliminaries, page 1 AWT. CSI 3125, Preliminaries, page 2 AWT Java AWT (Abstract Windowing Toolkit) is an API to develop GUI or window-based.
1 Drawing C Sc 335 Object-Oriented Programming and Design Rick Mercer.
1 Introduction to J2ME Outline MIDP Building J2ME Apps- Tool J2ME Wireless Toolkit Demo MIDlet Programming -- MIDlet Transition States -- Midlet Skeleton.
CSE403: MIDlets and Ant1 MIDlets and Ant April 3, 2003 Shane Cantrell Zach Crisman.
Advance Computer Programming Market for Java ME The Java ME Platform – Java 2 Micro Edition (J2ME) combines a resource- constrained JVM and a set of Java.
UNIT II J2ME Best Practices and Patterns
Java N Amanquah.
Shane Cantrell Zach Crisman
Presentation transcript:

J2ME Form Nesneleri Melih Sakarya

Form Nesnesi Form form= new Form("Giris"); display.setCurrent(form);

Form Nesneleri  Canvas  ChoiceGroup  DateField  Display  Displayable  Font  Form  Gauge  Graphics  Image  ImageItem  Item  List  Screen  StringItem  TextBox  TextField  Ticker

Form()   public void setTitle(String title);   public String getTitle( );   public void setTicker(Ticker ticker);   public Ticker getTicker( );

TextField TextField textFieldName= new TextField(Title,Text,MaxLength, Constraints); ad.getString();ad.setString(String);

ChoiceGroup ChoiceGroup choices = new ChoiceGroup( “Label", Choice.EXCLUSIVE); choices.append("Bay",null);choices.append("Bayan",null);

DateField DateField date = new DateField(“Tarih", DateField.DATE);

Image Image image = Image.createImage("/Duke.png");

Form Nesneleri Form form= new Form("Giris"); TextField user= new TextField("Username:","",20,TextField.ANY); TextField pass= new TextField("Password:","",20,TextField.PASSWORD); ChoiceGroup cinsiyet=new ChoiceGroup("Cinsiyet", ChoiceGroup.EXCLUSIVE); cinsiyet.append("Bay",null);cinsiyet.append("Bayan",null); DateField tarih=new DateField("Dogum Tarihi",DateField.DATE); form.append(tarih);form.append(cinsiyet);form.append(user);form.append(pass);display.setCurrent(form);

List List list = new List(“Liste", Choice.EXCLUSIVE); list.append(“A", null); list.append(“Bl", null);

Formlar Arasi Gecisler Dispaly.getDisplay(this).setCurrent(formAdi);

Canvas public class DemoCanvas extends Canvas { public class DemoCanvas extends Canvas { Image image; Image image; public DemoCanvas (Image image){ public DemoCanvas (Image image){ this.image=image; this.image=image; } public void paint(Graphics g) { public void paint(Graphics g) { g.setColor(255, 255, 255); g.setColor(255, 255, 255); g.fillRect(0, 0, getWidth(), getHeight()); g.fillRect(0, 0, getWidth(), getHeight()); g.drawImage(image,10,10,Graphics.TOP|Graphics.LEFT); g.drawImage(image,10,10,Graphics.TOP|Graphics.LEFT); } }

Canvas public class MyCanvas extends Canvas { public void paint(Graphics g) { g.setColor(255, 0, 0); g.fillRect(0, 0, getWidth(), getHeight( )); g.setColor(255, 255, 255); g.drawString("Hello World!", 0, 0, g.TOP | g.LEFT); }

Konumlama

Cizim Metodlari drawImagedrawStringdrawRectdrawRoundRectdrawLinedrawArcfillRectfillRoundRectfillArc

Renk Formatlari setColor (255, 0, 0)Kırmızı setColor (0, 255, 0) Yeşil setColor (0, 0, 255) Mavi setColor (128, 0, 0) Koyu Kırmızı setColor (255, 255, 0) Sarı setColor (0, 0, 0) Siyah setColor (255, 255, 255) Beyaz setColor (128, 128, 128) Gri

Canvas import javax.microedition.midlet.*; import javax.microedition.midlet.*; import javax.microedition.lcdui.*; import javax.microedition.lcdui.*; public class CanvasTest extends MIDlet{ public class CanvasTest extends MIDlet{ public void startApp(){ public void startApp(){ TestCanvas canvas=new TestCanvas(); TestCanvas canvas=new TestCanvas(); Display.getDisplay(this).setCurrent(canvas); Display.getDisplay(this).setCurrent(canvas); } public void pauseApp(){} public void pauseApp(){} public void destroyApp(boolean unconditional){} public void destroyApp(boolean unconditional){} public class TestCanvas extends Canvas{ public class TestCanvas extends Canvas{ public void paint(Graphics g){ public void paint(Graphics g){ g.setColor(255,255,255); g.setColor(255,255,255); g.fillRect(0,0,getWidth(),getHeight()); g.fillRect(0,0,getWidth(),getHeight()); g.setColor(0,0,0); g.setColor(0,0,0); g.drawRect(10,10,50,50); g.drawRect(10,10,50,50); } } }

import java.io.*; import javax.microedition.midlet.*; import javax.microedition.lcdui.*; class ImageDemoCanvas extends Canvas { Image image; Image image; public ImageDemoCanvas () { public ImageDemoCanvas () { try { try { image = Image.createImage ("/logo.png"); image = Image.createImage ("/logo.png"); } catch (IOException e) { catch (IOException e) { throw new RuntimeException ("Unable to load Image: "+e); throw new RuntimeException ("Unable to load Image: "+e); } } public void paint (Graphics g) { public void paint (Graphics g) { g.setGrayScale (255); g.setGrayScale (255); g.fillRect (0, 0, getWidth (), getHeight ()); g.fillRect (0, 0, getWidth (), getHeight ()); g.drawImage (image, 0, 0, Graphics.TOP | Graphics.LEFT); g.drawImage (image, 0, 0, Graphics.TOP | Graphics.LEFT); g.drawImage (image, getWidth () / 2, getHeight () / 2, g.drawImage (image, getWidth () / 2, getHeight () / 2, Graphics.HCENTER | Graphics.VCENTER); Graphics.HCENTER | Graphics.VCENTER); g.drawImage (image, getWidth (), getHeight (), g.drawImage (image, getWidth (), getHeight (), Graphics.BOTTOM | Graphics.RIGHT); Graphics.BOTTOM | Graphics.RIGHT); }}

import javax.microedition.lcdui.*; public class FontCanvas extends Canvas { public void paint(Graphics g) { g.setColor(0xffffff); g.fillRect(0, 0, getWidth(), getHeight( )); g.setColor(0x000000); g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_LARGE)); g.drawString("System Font", 0, 0, g.LEFT | g.TOP); g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_MEDIUM)); g.drawString("Medium Size", 0, 15, g.LEFT | g.TOP); g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_MEDIUM)); g.drawString("Bold Style", 0, 30, g.LEFT | g.TOP); g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_ITALIC, Font.SIZE_MEDIUM)); g.drawString("Italic Style", 0, 45, g.LEFT | g.TOP); g.setFont(Font.getFont(Font.FACE_SYSTEM, Font.STYLE_UNDERLINED, Font.SIZE_MEDIUM)); g.drawString("Underlined Style", 0, 60, g.LEFT | g.TOP); }}

Extend Edilen Canvasi Kullanmak import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class FontMidlet extends MIDlet { public FontMidlet( ) { // constructor } public void startApp( ) { Canvas canvas = new FontCanvas( ); Display display = Display.getDisplay(this); display.setCurrent(canvas);} public void pauseApp( ) { } public void destroyApp(boolean unconditional) { }

SORULAR ???