Wrox Programmer Forums
|
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 9th, 2005, 04:52 PM
Registered User
 
Join Date: Sep 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Nazish Send a message via MSN to Nazish
Default java

Hi
I am in trouble
I have got some problems and wana get it solved
my papers are there on 28th of this month so reply quickly
Nazish
with advance thanks


 
Old September 15th, 2005, 12:26 PM
Authorized User
 
Join Date: Dec 2004
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi there

plz send me your assignments or the programs in which you have problems. we will try to help you to our best.

take care and work hard


HumaMunir
 
Old September 19th, 2005, 12:09 AM
Registered User
 
Join Date: Sep 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Nazish Send a message via MSN to Nazish
Default

Thanks Huma
I have got the program with me I hope you will help me make this.
"program that inputs a string from the keyboard and determines the length of the string. put the string using twice the length of field width"
The first part of this program I have made but the width creats problem for me
Espacially thanks to Huma
Nazish Fatima

 
Old September 23rd, 2005, 07:24 AM
Authorized User
 
Join Date: Dec 2004
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

dear nazish

i am really very sorry about the late reply. because of some network problems i cannot logged on to the site. if you can explain me what is the second part of your program in detail. i will INSHAALLAH help you out.

take care and work hard
sorry once again


HumaMunir
 
Old September 24th, 2005, 05:18 AM
Registered User
 
Join Date: Sep 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Nazish Send a message via MSN to Nazish
Default

I should have thanked to you.
Thanks a;ot once again to support me and help me out.
the second part ask " first find the length of any string then Print the string using twice the length of field width"
Thanks in advance
take care too
Nazish Fatima

 
Old September 27th, 2005, 10:09 AM
Authorized User
 
Join Date: Dec 2004
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

dear Nazish

here is your program but i am still confused with the field width. plz tell me clearly whether to increse the field length with the string size or width of it so i will do that also INSHAALLAH.

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;


public class NFString extends JFrame
{
    JLabel headl = new JLabel();
    public JTextField tf = new JTextField("",0);
    JPanel border1 = new JPanel(new BorderLayout(5,5));
    JPanel border2 = new JPanel(new BorderLayout(5,5));
    public JTextField tf1 = new JTextField("",0);
    public JButton b1 = new JButton();
    public String srg;
    public int spaces;

    public NFString()
    {

    super("String program");

    this.setResizable(true);
    Container content =getContentPane();
    headl.setText("Type a string");
    b1.setText("CHECK IT OUT");
    b1.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent ae)
            {
                if(ae.getActionCommand().equals("OK"))
                {
                    srg = tf.getText();
                int i2 = srg.length();
                for(int a=0;a<i2;a++)
                {
                    char ch = Character.toLowerCase(srg.charAt(a));
                    if(Character.isWhitespace(ch))
                    spaces++;
                }
                i2 = i2-spaces;
                tf1.setText("the string is "+srg+" and "+" its "+i2+" characters long");
                }

            }
            });

    border1.add("North",headl);
    border1.add("Center",border2);
    border2.add("North",tf);
    border2.add("Center",tf1);
    border2.add("South",b1);
    content.add(border1);
    pack();
}


    public static void main(String args[])
    {

    NFString nfs = new NFString();
    nfs.setVisible(true);




    }
}


take care and work hard



HumaMunir





Similar Threads
Thread Thread Starter Forum Replies Last Post
Root Cause:java.lang.NoSuchMethodError: java.util. anees81 JSP Basics 3 March 1st, 2011 08:55 AM
java.lang.OutOfMemoryError: Java heap space meetkotresh J2EE 1 February 2nd, 2008 01:52 AM
Java Media Framework(I am new to java) amirdiwan4eva Pro Java 4 July 12th, 2006 04:50 AM
Java Code - Wrox - Beginning JAVA - Ivor Horton ponguru Java Databases 3 May 18th, 2006 12:30 PM
Java vs Java Script functions joemorrison74 J2EE 0 July 6th, 2005 04:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.