Layout settings problem in Applet

hi
I got problem in setting up the layout in Applet for a calculator.I tried my best using GridLayout,BoxLayout etc but nothing hapened like a calculator. If any class else there with which I can do it easily please tell me..

here is a lil demo with GridLayout and BorderLayout.
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class KeyPadDemo extends Applet {
     KeyPad keyPad;
     TextArea textArea;
     public void init(){
          this.setSize(300,300);
          this.setLayout(new BorderLayout());
          this.add(textArea = new TextArea(), "North");
          this.add(keyPad = new KeyPad(textArea),"Center");
class KeyPad extends Panel{
MyButton buttonZero, buttonOne, buttonTwo,
buttonThree, buttonFour, buttonFive, buttonSix;
MyButton buttonSeven, buttonEight, buttonNine,
buttonDecimal, buttonZeroZero;
     TextArea outputArea;
     KeyPad(TextArea outputArea){
          this.outputArea=outputArea;
setLayout(new GridLayout(4,3));                    //GUI number
r button pad
          add(buttonSeven = new MyButton("1"));
          add(buttonEight  = new MyButton("2"));
          add(buttonNine = new MyButton("3"));
          add(buttonFour = new MyButton("4"));
          add(buttonFive = new MyButton("5"));
          add(buttonSix = new MyButton("6"));
          add(buttonOne = new MyButton("7"));
          add(buttonTwo = new MyButton("8"));
          add(buttonThree = new MyButton("9"));
          add(buttonZero = new MyButton("0"));
          add(buttonDecimal  = new MyButton("."));
          add(buttonZeroZero = new MyButton("00"));
class MyButton extends Button implements
ActionListener{
          String string;
          public MyButton(String string){
               super(string);
               this.string=string;
               addActionListener(this);
          public void actionPerformed(ActionEvent e){
               outputArea.append(string);
===============================================================
Thank you for writing the code. But I have done it using GridBagLayout.
thankyou again for ur solution because I got that how to do the same thing with a different source(GridLayout,BorderLayout).

Similar Messages

  • Why does FireFox change layout/settings during upgrades without asking ?

    Just upgraded to Firefox 18 (windows 7 desktop). Why does Firefox change layouts/settings without asking the user if he wants it or not???
    I am getting sick of those changes. I want to have at the google main page the options (as before) to search in all languages, or pages from a certain language or pages in a certain language (of course depening of the google address; f.i. at google.de for german languages, google.fr for french languages etc).
    In the latest Firefox 17 it was working as I wanted and described before: when I visited www.google.de/firefox of www.google.fr/firefox. Now those 3 options (under the search bar) are gone and I do not want to operate by clicking on the advanced search button. Those things should be visible under the search bar again.
    Also my STARTPAGE was GONE/DELETED after the update !!! Grrrrr.... Updating is OK but mozilla should not change user configured items !!!!!!!
    The above described problem has nothing to do with the google website.

    By the way, do Firefox and IE use the same proxy settings? You can view Firefox's here:
    orange Firefox button (or Tools menu) > Options > Advanced > "Network" mini-tab > "Settings" button
    The default is "Use system proxy settings".

  • Caching problem in Applets - Java Control Panel

    I have a problem of applets being cached in Java Control Panel. Is there a way in Java to stop caching applets programatically in the Java Control Panel.
    There is one way to stop caching files by unchecking "Keep Temporary Files on my Computer" under Java Control Panel --> General --> Settings page.
    But I want to do this programatically using some Java programming/Java Scripting/some parameter in applet tag.
    Some solutions like setting cache_option = No, cache_archive= jar file name in PARAM tag in applet and classloader_cache="false" have been already tried. But noting is seeming to be working out.
    Can somebody please provide a solution.

    Following is the listener status
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Produ
    ction
    Start Date 11-APR-2007 11:51:12
    Uptime 0 days 0 hr. 1 min. 28 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File I:\oracle\product\10.2.0\db_1\network\admin\listener.o
    ra
    Listener Log File I:\oracle\product\10.2.0\db_1\network\log\listener.log
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=jbpsouthcbg)(PORT=1521)))
    Services Summary...
    Service "jbpsouth" has 2 instance(s).
    Instance "jbpsouth", status UNKNOWN, has 2 handler(s) for this service...
    Instance "jbpsouth", status READY, has 2 handler(s) for this service...
    Service "jbpsouth_XPT" has 1 instance(s).
    Instance "jbpsouth", status READY, has 2 handler(s) for this service...
    The command completed successfully

  • Layout settings??

    Hi all,
    I have a problem with frequent changes in report layout setting. When users trying to create a user specific layout in the window "Default" is set, out of "User specific" & "default" checkbox defaultly, so users saving the layouts. so it's overwritting on existing layout. we are ossing the old data. how to restrict end users to create new one with out changing the existing one.How to change that default check in "Default" check box to user specific defaultly. where i have to do settings for this. Thanks in advance.
    Pradeesh

    Hi,
        This is more a training issue. The layout settings are meant so that user as per his requirement can set his own layout in reporting.
    Conduct a training session and guide them how they can use there user specific layout.
    This will resolve your issue.
    Regards
    Rajesh

  • Problem downloading applet in W2K with SP4.

    Hi,
    We are using a Security Applet in our web application for validation purposes. We were using W2K Professional / W2K Server with SP3 and Sun JRE 1.3.x. The application was working as expected.
    We are now testing with W2K Server with SP4 (to upgrade to SP4). The current testing environment is W2K Server with SP4 and Sun JRE1.3.x. Now with the setup, we are facing a problem in downloading the applet (Security Applet). The downloading applet fails and the subsequent loading as well.
    Please advice. Does it requires any particular settings to be done at Client?
    The specs are
    Windows 2000 Server, SP4
    IE 6 SP1
    Sun Jre 1.3.x
    Problem:Downloading applet fails.
    PS: When we test with SP3, we can see the applet downloaded (CAB File), with SP4 it was not found.
    Thanks in Advance,
    Prakash

    Does the w2k sp4 server host your pages and applet?
    If yes then why install the SUN JRE 1.3 on the server, doesn't the client need this?
    Is the cab format supported by SUN jre or is it meant for msjvm and if so why is the client trying to open
    the cab with sun jre?
    http://java.sun.com/j2se/1.4.2/docs/guide/deployment/deployment-guide/upgrade-guide/article-02.html
    What's on the server doesn't have anything to do with the applet. The server is
    just serving it. Forcing the client/consumer of the html page with the applet is trying to open an applet
    with sun jre while the applet is ment for msjvm causes the error.
    The client can fix this by opening IE and check under tools -> internet options -> advanced -> UNCHECK
    the use sun jre ... for <applet tag. For the XP machine you might have a problem. Some of the don't have
    the msjvm at all so there is nothing to run the <applet, I tried to download it at microsoft but was unable
    to find it.

  • Applet Not Running in IE. Need IE settings for running applet.

    Hi
    I am facing a problem with Applet while running in IE-6. The problem is very simple; Applet is not running in IE-6, not even a simple applet which displays just a Label.
    I am using Java Version 1.4
    Settings for IE is as follows
    Java (Sun)
    CHECKED Use Java 2 v1.4.0 for <applet>
    Microsoft VM
    CHECKED Java console enabled
    NOT CHECKED Java logging enabled
    CHECKED JIT compiler for virtual machine enabled
    The applet is running in Appletviewer and run in IE in some other machine. The problem is in my browser and Java versions.
    If I start the applet in IE it is not showing even Jave Console (which is enabled).
    In Java Plugin (Control Panel) I enabled Show Console and set MSIE checked.
    What should I do to solve such a stupid problem with my IE. I have updated my JVM and IE twice but yet to wait for solution.
    Your help is worshipfully appericated.
    with love Vijay

    I got some reasonable solution from some other forum.
    The Problem is with the VM. The JVM is crashed with MS VM.
    That is why the browser diplays class not found error.
    This is because the MS VM is not allowing the JVM to look for .class files.
    This will happen for java 1.4.x .
    If you use HTML converter (converting the applet to object) it will work.
    But the Optimal solution is compile your applet file with -target option.
    e-g
    javac target 1.1 HelloWorld.java
    It is the most efficient way to avoid such problems with IE while running the applets.
    I Thank you all for your solutions.
    with love Vija

  • Problem in Applet while communicating with Javascript

    Hi,
    I’m facing a problem with applet. Applet calls JavaScript methods and vice versa. Applet works fine with JRE 5 to JRE 6 up to build no 1.6.0._7 but it fails with build no 1.6.0_10.
    The problem description is given below:
    After embedding applet in my HTML page using <OBJECT> tag, I’ve to check either any problem during applet’s execution, I want to get the error reason by calling my defined method getErrorReason() in applet that returns the error reason, I call the getErrorReason() against the applet’s object in JavaScript immediately after embed applet code in my HTML page, a JavaScript errors occurs and my applet fails to perform its execution.
    JavaScript error: Object does not support this property.
    The error points to the HTML page area where I’m calling getErrorReason() against applet object.
    The above JavaScript error occurs after the successful completion of Applet’s init(). I’m facing this problem only in JRE 6 build 1.6.0_10-b33.
    Please suggest me any solution.
    Thanks in advance.
    Regards,
    Israr Ahmed

    Hi Bharath,
    Even i got similar error and i tried deleting the below(Attaching the stack trace is always better way.)
    1) delete the folder ‘workspace’ or rename(including all files and subfolders) in the path D:\Documents and Settings\lzcr8r\Documents\SAP\workspace
    2) delete all .dtr/.dtc/.metadata directories in your personal folder (e.g. C:\Documents and Settings\lzcr8r).
    Restart the IDE once you are done with the above steps.
    Second part to increase the virtual mem
    1) RtClick on the Shortcut of NWDS -->Properties and in the Target put the below
    "C:\Program Files\SAP\IDE\IDE70\eclipse\SapIde.exe" -vmargs -Xms512m -Xmx1536m  "C:\j2sdk1.4.2_08\bin\javaw.exe"
    2) You can also try  Creating a bat file with the complete path of your IDE and start your ide from the bat
       content in the bat eg: "C:\Program Files\netbeans-4.1\bin\netbeans.exe" -vmargs -Xms512m -Xmx1536m
    Here -Xms512m is the min JVM size and -Xmx1024m is the max JVM size.
    You can place this batch file anywhere and double click the batch file.
    It will automatically start your IDE
    3) if you are using Tomcat you can try creating an env variable and assign Value
    Variable Name:  CATALINA_OPTS
    Variable Value:  -server -Xmx800m
    please award points if usefull.
    Regards
    Souza
    Edited by: Souza Aluri on Apr 9, 2008 9:46 AM

  • Is it possible to change the ALV report layout settings in spool request

    Hi All,
    Please let me know is it possible to change the ALV layout settings in background as we can change the layout settings in foreground to get correct format when download to excel.
    Regards,
    Jyothi CH.

    Hello,
    Add a parameter for layout on selection-screen (p_varmm LIKE disvariant-variant).
    As you are in backgroud mode, ALV will be printed with this layout (assuming you call correctly the MF ALV_LIST or REUSE_ALV_GRID)
    Regards,
    Christophe

  • Problem calling applet method using IE

    I've searched through the forum and can't seem to find anything that can help me fix this. I'm trying to call an applet's method using Javascript. This is working fine under Netscape, but not IE. Everything I've read seems to indicate that I'm doing this right, but I'm getting "Object doesn't support this property or method" when I try to call the applet method from IE.
    In this example method, I'm trying to call the applet's countChars method, which should return the length of the string you pass into it. Works under Netscape 6.2, but not IE 6.0
    Here's my applet code:
    import java.lang.String;
    public class test extends java.applet.Applet {
    public static int countChars(String s) {
    return s.length();
    And my HTML
    <HTML>
    <HEAD>
    <script language="Javascript">
    function refreshApplet()
    /*     i = document.forms.myForm.TestApplet.countChars();
         document.forms.myForm.output.value=i; */
         document.forms.myForm.output.value=document.applets["TestApplet"].countChars(document.forms.myForm.input.value);
    </script>
    </HEAD>
    <BODY>
    <APPLET CODE = "test.class" WIDTH = 400 HEIGHT = 400 ALIGN = middle NAME = "TestApplet" scriptable="true">
    </APPLET>
    <br>
    <form name="myForm">
    <input type="text" name="input">
    <input type="button" value="click me" onClick="refreshApplet();">
    <hr>
    <input type="text" name="output">
    </form>
    </BODY>
    </HTML>
    Thanks in advance!
    Craig Drabik
    Sr. Programmer/Analyst
    University at Buffalo

    I have very similar problem, my applet works OK using Netscape (6.2 and 7.0), but with IE 6.0 It only works with windows XP;
    The reported error is "Object doesn't support this property or method"
    Can someone please help me to solve this problem.
    Cheers
    Horus
    This is my code:
    - I call the applet using javaScript and input the method setData with two strings.
    function graphic()
         var dataZenith;
         var dataManual;
         initVariables();
         dataZenith = graphicZENith(); //Call other Javascript functions
         dataManual = graphicManual(); //Call other Javascript functions
         document.AppletOne.setData(dataZenith,dataManual);
    I run the applet with this HTML code:
    <applet NAME="AppletOne" code="Appl.class" width="450" height="450"
    MAYSCRIPT></applet>
    //Applet code/////////////
    import java.awt.*;
    import java.awt.geom.*;
    import java.applet.*;
    import java.util.*;
    public class Appl extends Applet {
         private int [] myArray1 = new int [156];     
         private int [] myArray2 = new int [156];
         private boolean flag = false;
         // maxDataYAxesNumber es usado para dividir el eje de las Y
    public void init()
              setFont(new Font("SansSerif", Font.BOLD, 12));
              setBackground (Color.white);
              setSize(getSize());     
    // Get data and put in an array
    public void setData(String data1, String data2)
              final String DELIMITER = ",";
              final StringTokenizer theTokens1 =
                   new StringTokenizer(data1, DELIMITER);     
              final StringTokenizer theTokens2 =
                   new StringTokenizer(data2, DELIMITER);
              try
                        String dataX = data1;
                        for (int i = 0; i < 156; i++)
                        myArray1[i] = Integer.parseInt(theTokens1.nextToken().trim());
                        myArray2[i] = Integer.parseInt(theTokens2.nextToken().trim());
              catch (NumberFormatException e) {};
              flag = true; //I get the data OK
              repaint();
    public void paint (Graphics g){
    Graphics2D g2d = (Graphics2D)g;
    setData(data1, data2) ;
    if (flag == true)
                   //Call other functions to process the graphic
    else g2d.drawString(" Sorry I can get Data", 100,80);          

  • ICal settings problem.

    I have an iCal settings problem. I simply cannot change the format to 12 hours. I have repeatedly set the system to 12 hours and that works fine. I have re launched iCal several times to no avail. Running system 10.6.7 and iCal is 4.0.4. Any ideas? Thanks. Geoff.

    iCal takes its format from System Preferences>Language& Text>Formats.
    Click on the 'Customize' button for 'Time' and set as here:
    Then drag the  'PM' button in the 'Time Elements' section to after the short time - though when I tried this it didn't appear in iCal. You may need to experiment a bit.

  • Change of page layout settings in bsp

    HI Gurus,
    i am working on customizing a weblayout for objective settings&appraisals(ecc6.0).
    I have defined the classes and methods in bsp applications.
    I need to customize the page layout and split the frame work of the layout into header and details part.
    I am not able to find the web layout settings(where should the web layout settings changed.
    Awaiitng on ur replies.
    Thanks&Regards
    Pradeep

    Harry,
    Short answer: No - either a shape or some other media - when placed using the Document Setup options, the color shape is placed in the background of all other objects (it becomes the page color) anything placed on the page in the normal Edit Mode will be on top of the background and not hidden.
    See attached images - I placed a shape on part of the document to show the original and added color - if you stretch the shape to cover the page, the entire page will take on the color of the shape:
    Try it.

  • [Solved]Gnome settings problem

    Hi all.
    I have some strange problems with Gnome 3.2, it is hard to explain but these screenshots should:
    http://bildr.no/image/1012613.jpeg
    http://bildr.no/image/1012614.jpeg
    In the first picture you can see that something that is selected by default is pink, this happens all over Gnome. In the second one you can see that in nautilus when I want to select with the mouse it creates a white block so you can't see behind. I know it is a settings problem because the same doesn't happen on a new account, but the problem is that I have tried to delete .gnome2/ .gconf and .config but once I start to customize again the problem reappers. So I was wondering if there is anything else that I can try to delete without deleting the whole account or if there is some settings that I could to to remove this problem.
    Thanks in advanced
    Mod edit: The included images are too big, see our forum etiquette about this. For  screenshot posting rules you may also look here.
    Last edited by nordmoen (2011-11-01 13:57:18)

    caligo wrote:If you launch a GTK3 app from the terminal, are there any GTK related error messages (e.g. CSS errors)?
    Yes!
    Havn't noticed that before:
    (gnome-system-monitor:3153): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:620:27: Whitespace between 'url' and '(' is deprecated
    (gnome-system-monitor:3153): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:626:27: Whitespace between 'url' and '(' is deprecated
    (gnome-system-monitor:3153): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:632:27: Whitespace between 'url' and '(' is deprecated
    (gnome-system-monitor:3153): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:639:27: Whitespace between 'url' and '(' is deprecated
    (gnome-system-monitor:3153): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:645:27: Whitespace between 'url' and '(' is deprecated
    (gnome-system-monitor:3153): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:651:27: Whitespace between 'url' and '(' is deprecated
    (gnome-system-monitor:3153): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:657:27: Whitespace between 'url' and '(' is deprecated
    (gnome-system-monitor:3153): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:663:27: Whitespace between 'url' and '(' is deprecated
    (gnome-system-monitor:3153): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:669:27: Whitespace between 'url' and '(' is deprecated
    (gnome-system-monitor:3153): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:675:27: Whitespace between 'url' and '(' is deprecated

  • How to Email POWL Reports / Apply Web Dynpro ALV Table Layout Settings

    Hi all,
    we want to be able to automatically extract POWL reports and email them to users in a batch job.
    We can refresh a POWL report using FM POWL_QUERY_REFRESH, and access the raw report data using method CL_POWL_QUERY_ACCESSOR=>GET_CACHED_RESULTS.
    However this merely gives us a table of raw data.  No view layout (ie. Web Dynpro ALV table layout) settings have been applied, so there is no hiding or arranging of columns, row sorting, calculations or filters.
    Ideally we would like to be able to specify a query and view layout.  The batch job would then refresh and extract the data, and format the data according to the view layout before sending it on as an attachment in an email.
    Does anyone know how to determine and apply Web Dynpro ALV table layout settings to format table data outside of the Web Dynpro environment ?
    Thanks & regards,
    Grogan

    Hi Grogan,
    Did you find out how this works..i also have the same issue.
    Thanks
    Jdsouza

  • Satellite L40-14F - Display settings problem

    Hi,
    I have Toshiba Satellite L40-14F with Intel GMA X3100 video card.
    I have display settings problem, I can't change screen resolution and color quality when video card drivers are installed, screen resolution is 800 by 600 pixels and color quality is lowest 4 bits, when i uninstall video card drivers can change it. I try to install other drivers, there are the same problem :( Please help me :)
    Regards

    I updated BIOS then install video card drivers and it works :)

  • Disabling the Layout settings Option in ME51 Transaction

    In  ME51N transaction for creating PR I want the Layout Settings button in the Item overview to be disabled so that user can not change the layout . How to do..?

    Hi,
    u need to create TRANSACTION VARIANT in TCODE-SHD0.
    Regards,
    Nagaraj

Maybe you are looking for

  • How can I open an acsm file in ADE?

    I am trying to write instructions for someone new to e-readers. Here is the issue. We downloaded e-books from the Ottawa Public Library. The file offered was an acsm file. We saved it to the desktop. When we opened ADE and used the "add to library" f

  • CS4 Asset Management

    Hi, I’m having some difficulties implementing asset management in our CS4 InCopy and InDesign plugins. I seem to have the basics right but I’m lacking some refinements. I’ve created implementations of IAMSystemProvider, IAMServiceProvider and IAMServ

  • Wont charge or appear on pc..

    my ipod will not connect to anything, when i plug the cable into the computer or laptop, the ipod screen lights up,but nothing pops up on it like its supposed to, and the computer does make a sound when i plug it into there, but nothing pops up on it

  • My iPhone's notes are gone.  I noticed this after I did the latest update.  What happened to them?

    My iPhone's notes are gone.  I noticed this afte rI did the latest update.  What happened to them?  I think I back up my phone before I did the update, but I'm not sure to where or how.  How do I get to them?  I had so many important notes.

  • Steps for Creating Report  using LDB

    hellow sirs can u please tell Step by Step method for creating Reports using LDB method... if possible with screen Shots.. thanking You Rahul