Shall i use Swing or AWT for creating a chessboard applet??

Hi,
I need to build an applet which should dislpay a chessboard where i should
be able to move the pieces around, read in a game analysis, etc...
I am a beginner and i would like some advice on if i should use swing or awt?
Which one is it easier to work with in terms of dispaying the pieces, moving the pieces and achieving other more challenging functionalities?
Is it good idea to mix both of them? i.e have a japplet and use a canvas for displaying the board??
Any advice would be much obliged.

I used to think AWT
And someone told me Swing was better..and that all of the Drag-n-Drop stuff doesn't work well with AWT.
I have to admit that I used AWT up until a project about 3 months ago--I liked it better, but Swing does seem to have more builtins for handling the things you would need to for the Chess Board. Not that you CAN'T do them with AWT, but that they are harder to do with AWT.
As far as reading in game analysis, etc..that really is independent of Swing/AWT

Similar Messages

  • Need  java code to perform refresh button action using swings and awt

    i need java code to perform refresh button action using swings and awt.please help me

    Wait ! Noboby ? OK, I'll do it
    public void onBtnAction ()
        if (!fresh)
            refresh ();
    }Seriously, did you expect anyone to answer such a cryptic question ?

  • Is it possible to use events for objects that do not use swing or awt

    Dear Experts
    I want to know if events are possible with plain java objects. A simple class that is capable of firing an event and another simple class that can receive that event. My question is
    1. If it is possible - then what is the approach that needs to be taken and would appreciate an example.
    2. Is Observer Pattern in java going to help?
    To explain further i am doing [Add,Modify,Delete,Traverse] Data tutorial using swing in Net beans. I have a ButtonState Manager class that enables and disables buttons according to a given situation. For example if add is clicked the modify button becomes Save and another becomes Cancel. The other buttons are disabled. What i want is the ButtonStateManager class to do a little further - i.e. if Save is clicked it should report to DBClass that it has to save the current record which was just added. I am foxed how this can be done or what is the right way. Thanks for reading a long message. Appreciate your help.
    Best regards

    Thanks Kayaman
    i guess i am doing something else maybe it is crazy but i need to work further i guess... i cant post the entire code as it is too big but some snippets
    public class DatabaseApplication extends javax.swing.JFrame {
        ButtonStateManager bsm;
        /** Creates new form DatabaseApplication */
        public DatabaseApplication() {
            initComponents();
            // ButtonStateManager has a HUGE constructor that takes all the buttons as argument!
            bsm = new ButtonStateManager(
                    btnAdd,
                    btnModify,
                    btnDelete,
                    btnQuit,
                    btnMoveNext,
                    btnMovePrevious,
                    btnMoveLast,
                    btnMoveFirst );One of the methods in the ButtonStateManager Class is as follows
      private void modifyButtonState()
            btnAdd.setText("Save");
            btnModify.setEnabled(false);
            btnDelete.setText("Cancel");
            btnQuit.setEnabled(false);
            ...Finally the Crazy way i was trying to do ... using EXCEPTIONS!
      void modifyClicked() throws DBAction
            if(btnModify.getText().equalsIgnoreCase("MODIFY"))
                modifyButtonState();
            else
                throw new DBAction("SaveAddedRecord");
        }And Finally how i was Tackling exceptions....
      private void btnAddActionPerformed(java.awt.event.ActionEvent evt) {                                      
          try {
                bsm.addClicked();
            } catch (Exception e1) {
                processDBAction(e1.getMessage());
        private void processDBAction(String msg)
            if(msg.equalsIgnoreCase("SAVEMODIFIEDRECORD"))
                System.err.println(msg);
                bsm.normalButtonState();
            }Edited by: standman on Mar 30, 2011 4:51 PM

  • Can we use IDOC_INPUT_ Message type for creating and changing the document

    Hi,
    I have a requirement to create or change the requisition data.
    Can I use IDOC_INPUT_PREQCR01 function module for both the purpose.
    OR shall I go for custom function module by using BAPI function modules to create or change the data.
    Please help me in this regarding.
    Answers will be rewarded.
    Thank you.
    Eswar

    Hello Eswar
    You could use the IDoc processing function module if you had the data already available in the IDoc specific format (which is unlikely). This would mean you are receiving the IDoc data from another SAP system.
    Instead, check the BAPI explorer (transaction BAPI) if you can find an appropriate BAPI.
    Regards,
      Uwe

  • Why we use  package seperate folder for creating packages ?

    hi
    i have two doubts
    1) in packages why we put seperate folder for pacage.. for creating the packages...?
    2)with out creating the package folder ..is possible to any other way is there ?
    thanks !!!

    balakrishna.m wrote:
    if is it there any option to create one folder..
    all packge programs are saved into that folder.. "no need to creating a seperate folders".. ?Here's a suggestion.
    Instead of continuing to waste everyone's time (including your own I might add) by repeating the same question in different forms why don't you ask us/tell us about the real problem that prompted this question in the first place.
    I would guess that your real issue here is one of the following.
    1)
    Question: You don't want to have to create 100 folders.
    Answer: Get an IDE.
    2)
    Question: You have actually hit some limit on some filesystem with regards to the number of directories in a directory.
    Answer: Rethink your design for starters. It sounds like you have too many packages. You can also look to solve this in alternative ways (like putting the source/classes in different locations and using the classpath appropriately)
    3)
    Question: You just don't understand what packages are for.
    Answer: Read the tutorial
    4)
    Question: You just don't like packages.
    Answer: Tough. Accept it or choose another language.
    If your real question doesn't appear above please ask it. But don't ask again if you must create different folders for different packages, that question has been answered repeatedly already.

  • Using Swing how can we create socket and send data thru TCP/IP on the socke

    Hi All,
    Can anyone tell the link or answer to me about the Socket programming using Swing and data get & post onto the socket.
    Thanx & Regard
    Ashu

    swing is nothing to do with socket programing, you need to code using core java and API of net
    so please go through this link [http://www.javaworld.com/javaworld/jw-12-1996/jw-12-sockets.html]

  • How to use a single page for create and update mode.

    Hi,
    I need to develop a single page to be used for both create and update modes.
    I am going to use a variable MODE
    and i will set this in the emp summary page.
    Based on the button clicked by the user i have to render the JSF page.
    For tis if the user selects a perticular and cliks on update thn i will pass the empno to the next.
    so there in the next i will appy a ViewCreiteria on my View Obj to fetch only that row so that only that emp will be displayed ion update mode.
    This is working fione for me.
    So now the issue is
    when the user clicks on CreatEmp button.
    i need to enable my VO for insert operations.
    for this i wrote the code like this in the beforePhase event
    FacesContext ctx = FacesContext.getCurrentInstance();
    ValueBinding valBinding = ctx.getApplication().createValueBinding("#{data}");
    BindingContext bContext = (BindingContext) valBinding.getValue(ctx);
    DCDataControl dcControl = bContext.findDataControl("DataControl");
    Application app = ctx.getApplication();
    ApplicationModule am = (ApplicationModule) dcControl.getDataProvider();
    System.out.println("After Appmodule initiation");
    // get the VO reference and initiate the query
    System.out.println("Before Page VO initiation");
    PrismDmPageSectionViewImpl vo = (ViewImpl)am.findViewObject("View");
    //ViewRowImpl row = (ViewRowImpl) vo.createRow();
    /* TO CREATE AN EMPTY ROW*/
    Row row=vo.createRow();
    System.out.println("New Row is created");
    //vo.createKey(row);
    vo.insertRow(row);
    vo.setCurrentRow(row);
    By doing this a new empty page is rendered.
    But when i fill up the values and click on ok.. i am getting the error like this..
    JBO-27023: Failed to validate all rows in a transaction.
    JBO-27027: Missing mandatory attributes for a row with key null of type View3
    JBO-27014: Attribute Id in View3 is required
    JBO-27014: Attribute PageeId in View3 is required
    Please point me out where i am missing.
    Thanks

    Hi,
    In my opinion you are over complicating things.
    This is what I do for using the sme page as both create and update without all this code.
    1) Create a browse page containing a an adf table with a select one component bound to your view object.
    2) Create an additional edit page containing only an edit form containing fields of your view object that your users must enter in order to add or edit rows.
    3) Link the pages in the JSF diagram with an "edit" navigation case from browse to edit page and a "return" navigation case from edit to browse (make sure that redirect option is NOT set on both cases)
    4) Remove the submit button from the edit page and add two application module bindings for the commit and rollback operations as command buttons in the form footer facet. Make sure that both buttons has an action of return and that their disabled property is set to false. You will probably change their labels to ok and cancel respectively.
    5) Drop a create action for your view object from the data control palette inside your page as a command button and set the action property to edit also.
    3) Set the action property of the view button to edit
    This should basically work without any code from your part. -- at least it does so for me -- if you like to make it a bit more funcy you may add am action listener inside your buttons and set a requeScope variable for example #{requestScope.editing} to true or false depending on the button clicked. Then add a title to your page with a value like #{requestScope.editing == true ? 'Editing record' : 'Adding a new record'}..
    Hope that helps.
    Thanassis

  • Using acrobat pro 9 for create web publication

    I have seen a few publication for that I would like to do but not sure how to. Here is a example for what I’d like to create: http://www.bluetoad.com/publication/?i=6845
    I have acrobat pro 9 and in-design. Basically I have a 28 page publication that I know how to save as a pdf, would but like take it, after it is in acrobat, and save as a web publication. I have using iWeb for my web authoring program. Well if anyone would look that link about, I this I like to know to do. Not even sure in it can to done in iWeb. If not and there is another way that would be great as well.
    Thanks

    You didn't forget to Advanced menu and set Reader Rights.Once you do that then, they can save and send back to you.

  • Difference in using EC02 and OX10 for Creating new plants

    Hello experts,
    I would like to know the impact of using both the transactions
    Thanks
    Imraan

    Dear mimraan70,
    EC01 is used for organization structure,here one compay code how many plants you assigned and how many purchase organizations assigned like you do here
    were OX10 is changing address and creating new plants etc,but in EC01 we cant create plant
    Hope this may helps you
    Prem.

  • Hi I'm trying to find a simple bit of freeware that I can use to image map for creating hotspots on a website.  Any ideas?

    Hi
    I'm wanting to create a pretty complicated image map for a web page so it'll be lot's of polygons.  Does anyone know of a good bit of freeware I can use that will help me work out the coordinates for the image maps?
    Thanks
    Neil

    You could do this in any text or html editor.t I imaging you want a click and drag capability when selecting the areas of the image map. Try looking at some of these. https://www.google.com/search?q=image+map+create+apple+mac

  • Shall we use virtual machine(vmware) for signing windows driver?

    Recently I have purchased code signing certificate from CA and it is mentioned that the machine which is used to generate a certificate should be the same which will be used for signing. To avoid problems in future, is it possible to use virtual machine
    for signing windows driver and take backup of Virtual machine to use in any machine in future?

    I don't think that is necessary, you need to be very careful about how you store and persist the cert
    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

  • How can i connect multiple forms using swings or applets(AWT) & with D-Base

    Hello Friends,
    I am Sreedhar from Hyderabad. working as a java developer in a small organization. I got a challenge to work on java stand alone (desktop) application. Basically our company is based on SCM(Supply Chain Management), I never work before using swings and AWT. now my present challenge is to develope an application on swings and AWT using Net Beans IDE. but i am unble find the code to connect one form to another form, i want to develop similar application like a web application , suppose if i click on OK button it has to connect next form. in the next for it has to take user name and password should allow me to access main form. please help me about this topic, if anybody interested i can send u the screen shots and i can post to ur mail. please help me as soon as possible,

    sreedharkommuru wrote:
    Hello Friends,
    I am Sreedhar from Hyderabad. working as a java developer in a small organization. I got a challenge to work on java stand alone (desktop) application. Basically our company is based on SCM(Supply Chain Management), I never work before using swings and AWT. now my present challenge is to develope an application on swings and AWT using Net Beans IDE. but i am unble find the code to connect one form to another form, i want to develop similar application like a web application , suppose if i click on OK button it has to connect next form. in the next for it has to take user name and password should allow me to access main form. please help me about this topic, if anybody interested i can send u the screen shots and i can post to ur mail. please help me as soon as possible,There is no magic, you need to spend a good amount of time in tutorials, here is a good one to start off with:
    [The Really Big Index|http://java.sun.com/docs/books/tutorial/reallybigindex.html]
    Here are a few tips:
    1 - Do not mix AWT and SWING: it'll just cause you headaches in the long run that you cannot fix without refactoring to properly not mix the 2 together.
    2 - You use JDBC to access the database
    3 - You make accessors/constructors to pass parameters that you need from one form to another.
    Have fun.

  • Possible for using profiler for creating workload for Database Engine Tuning Advisor in case of SSRS reports

    I have SSRS reports with each 5 parameters. Parameter datasets includes statements like WHERE @CategoryKey
    I have 20 tables in SQL Server. We don't have OLAP cube.
    I have created SQL Server Profiler trace. I have clicked all reports during process.
    I have opened Database Engine Tuning Advisor.
     I have selected all tables to Tune.
     Tuning options are Indexes/No Partitioning/Keep all existing PDS
    Result is following:
     14% improvement
     10 recommendations (8 statistic for Calender table and 2 index for Calender)
    Tuning logs:
    S008 exec sp_executesql N'  LongSQLStatment including IN (@CategoryKey) Event does not reference any tables
    S007 Replaced event exec sp_executesql
    My question is that why I did not get any recommendations for other tables that Calender?
    Could it be because of SSRS parameters like @CategoryKey?
    Is it possible at all to use SQL Server profile for creating workload in case of SSRS reports with parameters?
    I have tables and reports like ProductSales, which I suppose should be get indexedbecause of WHERE statements.
     I have where statement like Month and Category and Color.

    Yes it is possible to capture a trace using profiler, but please provide the t-sql behind your dataset before I can answer your question about the DTA recommandations.
    Regards
    Rasmus Glibstrup
    http://blog.sqlguy.dk

  • File system using swing

    Hi,
    I am developing a standalone application using swing and awt. My requirement is to show directory structure like windows explorer. Do we have any built-in components in swing get this Done.
    Thanks
    mmb

    herez a sample code for you... not commented at all...
    import java.io.File;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    import javax.swing.event.TreeExpansionEvent;
    import javax.swing.event.TreeWillExpandListener;
    import javax.swing.filechooser.FileSystemView;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeCellRenderer;
    import javax.swing.tree.DefaultTreeModel;
    public class JExpTree extends JTree{
         FileSystemView fsv=null;
         File home=null;
         File[] temp=null;
         DefaultMutableTreeNode root=null;
         DefaultTreeModel treeModel=null;
         DefaultTreeCellRenderer treeRend=null;
         public JExpTree(){
              initialize();
              setModel(treeModel);
              setShowsRootHandles(true);
              addTreeWillExpandListener(new TreeWillExpandListener(){
                   public void treeWillCollapse(TreeExpansionEvent e){
                        ((DefaultMutableTreeNode)(e.getPath().getLastPathComponent())).removeAllChildren();     
                        ((DefaultMutableTreeNode)(e.getPath().getLastPathComponent())).add(new DefaultMutableTreeNode(null));     
                   public void treeWillExpand(TreeExpansionEvent e){
                        expandPath((DefaultMutableTreeNode)(e.getPath().getLastPathComponent()));
         public void expandPath(DefaultMutableTreeNode d){
              d.removeAllChildren();
              File[] tempf=((TreeFile)d.getUserObject()).getFile().listFiles();
              DefaultMutableTreeNode tempd=null;
              for(int i=0; i<tempf.length; i++){
                   tempd=new DefaultMutableTreeNode(new TreeFile(tempf));
                   if(tempf[i].isDirectory())
                        tempd.add(new DefaultMutableTreeNode(null));
                   d.add(tempd);
         public void initialize(){
              fsv=FileSystemView.getFileSystemView();
              root=new DefaultMutableTreeNode(new TreeFile(fsv.getHomeDirectory()));
              expandPath(root);
              treeModel=new DefaultTreeModel(root);
         public static void main(String a[]){
              JFrame j=new JFrame("TestFrame");
              j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              j.getContentPane().add(new JScrollPane(new JExpTree()));
              j.pack();
              j.setVisible(true);
    import java.io.File;
    import javax.swing.filechooser.FileSystemView;
    public class TreeFile {
         private File file=null;
         public TreeFile(File f){
              file=f;
         public File getFile(){
              return file;
         public String toString(){
              return FileSystemView.getFileSystemView().getSystemDisplayName(file);

  • Can i use FMS developer version for commercial purpose

    HI,
    Can I use flash media server4 developer version for commercial, if some one have knowledge about scope of the developer version then, please help me.
    Thanks
    Ram

    If you refer to EULA of FMS you will see below text corresponding to Developer License:
    .1.              Software  License.  Subject to the terms and conditions of this Agreement, Adobe grants to  Licensee a perpetual (except as set forth in Section 15) non-exclusive  license to install the Software on one (1) Computer  or Virtual Server and use  the Software delivered hereunder according to the terms and conditions of  this Agreement and the Documentation.  Unless indicated otherwise by the License  Key (as defined below) provided to Licensee, Licensee shall be deemed to have  licensed the Development Server. If Licensee has  licensed a Trial Version, in which case Section 2.2 applies, or if Licensee has  licensed Not For Resale Software, in which case Section 2.3 applies.
    2.1.1.         Development  Server License.  This Section 2.1.1 applies only if Licensee  has obtained a valid Development Server license to the Software.  In addition to  the other terms contained herein, (a) Licensee’s license to the Development  Server Software is limited to a maximum number of (i) ten (10) Concurrent Connections when using with the Real Time Media  Protocol (RTMP), and (ii) fifty (50) Concurrent Connections when using the Real  Time Media Flow Protocol (RTMFP); and (b) Licensee shall not use the Development  Server for load balancing.  No maintenance and support is available for the  Development Server.   
    So as per EULA you can use Developer Edition for commercial purpose with restriction that it cannot be used for load balancing or creating cluster of Developer Edition Network.
    You can refer to this old article when this part of EULA was introduced: http://www.flashcomguru.com/index.cfm/2006/10/9/fmsdevedition

Maybe you are looking for

  • Issue in deleting an app installed in IOS 7

    I'm facing issue in deleting an app which was installed in IOS 7 in both iPhone & iPad. Installed the app from the hosted server, Installation is complete. But the app remain in the grayed out state. When I try to delete the app, it is not getting de

  • How to making login id as one field in the coding

    hi, I need to make the id(login in sap) as one of the field and that should be automatically assigned to it once we login . wht kind of modifications to be done for this.....pls help me... Saurabh.

  • Print Status On AR Invoice

    Hi All, I need to create a UDF that will display the documents print status.  I have created the UDF and now I need to create a query that will look at the document number and then the print status and based on that return a yes or no value in my UDF

  • How to create Live Soccer/Basketball score templates in Photoshop CS 5.1/64BIT

    I have a video about a sport competition. You know, we all see these templates in TV/NET as a info table. I want to do it in Photoshop CS5.1. I heard that we can create the template in Photoshop and put it in Premiere. If yes, how ? Is there any tuto

  • Select Options copy from clip board

    Last time I checked this wasn't yet implemented and searching through the forums I have not found that to have changed.  Is this still a planned feature or has it been released in some version?