Newbie with problem on swing

hi guys,
i would like to ask about java swing
i want to create application without using to many frame
i.e. i only want to use 1 frame
let say i have a first page where i ask user to enter an ID and password, then when they click the button the frame stay the same but the component inside the frame will change to other component
i know there is a way where i can link the different frame but i think it's not a good application
how can i do it?
thanks!!

One way you could do it would be to implement a custom JPanel for each 'screen' of your program. Each JPanel could have a button or buttons which tell the JFrame:
remove(this);
add(nextJPanel);
If your program will use a large number of screens which all look quite similar, you will probably want to create an abstract subclass of JPanel; individual screens would be subclasses of the subclass.

Similar Messages

  • Help with problems in Swing

    Hi, I am trying to develop a simple applet where a user can click on the screen to add jbuttons at the location of the mouse click. I have written an overly complex set of code that tries to achieve this goal, and in the end I have come close. My applet allows the user to input a certain number, and then click that many times on screen to create more jbuttons. The problem is that whenever the user clicks on screen a jbutton is created, but it only appears once the mouse has moved over it. I find this pretty weird, but basically when the user clicks, a jbutton is created within the program, but it is only "drawn" to the screen when the mouse moves directly over it.
    www.geocities.com/nickv360
    Can anyone explain to me why this is happening?
    http://www.geocities.com/nickv360/Source/AirlineModel.java
    http://www.geocities.com/nickv360/Source/City.java
    http://www.geocities.com/nickv360/Source/DrawingCanvas.java
    These are the source files if that helps at all. Addtinonally, the reset button doesn't work. The way the applet is supposed to be set up is to have an array of cities (JButtons) stored in DrawingCanvas. The drawing Canvas then accesses that cities[] array and adds each city[i] to the map. If there are no cities in the cities[] array, then no cities will be added. So, in order to successfully reset the map, here is what I do:
    cities = new City[numCities];
    removeAll();
    index = 0;
    repaint();
    I change the cities[] array to a new array of cities. I use the removeAll() method to take away all the JButtons that are currently on the map, I reset the index counter, and I repaint. Unfortunately this doesn't work.
    Does anyone know why Swing won't paint my buttons until the mouse moves over them, and why the reset method I've written doesn't work? Thanks in advance to anyone who can help.

    Just wanted to let people know that I found the answer:
    As for the other problem, I think it has to do with you having overridden paint. Normally, when you call repaint on a container, it will automatically call repaint on all the components that it contains. I'm fairly certain that if you don't manually call super.paint(g); in your paint method, it won't do it for you.
    Calling super.paint(g) makes the all of the bugs in the code disappear.
    Thanks.

  • IMovie newbie with problems and questions

    I first posted this in iMovie 9 which was incorrect. I am at iMovie version 6.0.3.
    I am new to iMovie and am struggling with my first project. My current problem is with transitions and playback. I have added a transition between my first and second clips and it shows in the clip viewer. However, when I click on the first clip and click play the clip plays to it's end but the transition does not start. If I then click on the transition and click play it goes through the transition but the next clip doesn't start to play. In fact, none of the clips play unless I click on the specific clip and click play. I would expect the entire movie to play from start to finish. Am I missing something? The iMovie Getting Started instructions are not very helpful
    Thank you
    John

    Sorry guys (Klaus and Karsten). I didn't look thoroughly enough (most unlike me)! When the iMovie Help window appears (following the link Klaus provided), it is blank. But then I clicked on the Home button - the middle icon shaped like a house at the top left of the window. Immediately, the Help Index appeared from which I could access all the items.
    How embarrassing - I should have known better, having used Help many times in the past (in all versions of iMovie).
    Apologies also for my comment about Apple removing Support articles! I think baby sitting yesterday threw me off a bit
    For the benefit of other users (including John Hendrie, the OP), this is the link we are talking about (as kindly provided by Klaus): http://docs.info.apple.com/article.html?path=iMovie/6.0/en/imv1096.html
    John
    Message was edited by: John Cogdell

  • Newbie with Problems with E1500

    I have had an E1500 for 5 months with no problems-have Comcast internet.
    After doing firmware upgrade yesterday now my download speed is only .90 mpbs and upload is 5.50 .
    Speedtest with Comcast shows download speed at 35.5 - so they aren't the problem.
    I did change channel from 11 to 1 and that did not help.
    Just did the recycle and repowered with no help.
    I did add a blu-ray player and set up Samsung hub-would that affect the router?
    Thanks for any help you can give me. 

    StevieD49 wrote:
    I have had an E1500 for 5 months with no problems-have Comcast internet.
    After doing firmware upgrade yesterday now my download speed is only .90 mpbs and upload is 5.50 .
    Speedtest with Comcast shows download speed at 35.5 - so they aren't the problem.
    I did change channel from 11 to 1 and that did not help.
    Just did the recycle and repowered with no help.
    I did add a blu-ray player and set up Samsung hub-would that affect the router?
    Thanks for any help you can give me. 
    Just make sure firmware is updated if you still have the issue after following the steps provided by sabretooth. Reset and reconfigure after the update.

  • Newbie with problems opening an IPD file

    Hi everyone, I hope someone can help me asap please.........
    I made a back up on my desktop manager in the usual way and everything was fine.  I then went onto my PC to try and open the blackberry backup IPD file.  I right clicked on the blackberry file and clicked....." open with" and stupidly clicked paint.  Somehow this changed all my blackberry back up files to paint files.
    All I desperately want to know is.........
    When I right click on the blackberry file on my pc and open the properties tab, in the general section the type of file shows IPD file, but underneath it shows Opens with:   what should this show please?
    I have tried making another backup but each time it saves it to my pc it shows as an IPD file opening with Paint!!!
    Any ideas anyone???  Any help would be greatly appreciated.   Thank you

    You won't be able to show the content of an IPD file from your desktop directly. There is an application called ABC Amber BlackBerry Converter which can help you in getting the data. You can find the application from the below link -
    http://abc-amber-blackberry-converter.en.softonic.com/
    tanzim                                                                                  
    If your query is resolved then please click on “Accept as Solution”
    Click on the LIKE on the bottom right if the post deserves credit

  • Newbie with problems opening RAW files.

    I am new to using RAW files.  I started by following the instructions to download and install the new RAW plug-in for my CS2 version of photoshop.  When I open CS2 and choose bridge, I can see the thumbnail of the NEF file, but when I right click to open, there is no option for me to open as RAW file.  If I double left click to open it tells me it cannot open because it is the wrong type of file.
    Photoshop CS2 Ver 9.0
    Raw Plug-in Ver 3.7
    Camera Nikon D5000

    Unfortunately, ACR (Adobe Camera Raw) 3.7 doesn't support RAW files from Nikon D5000.
    Support for Nikon D5000 RAW was added in ACR 5.4. But, again, sorry to say you cannot install ACR5.4 for Photoshop CS2.
    Your best bet is to try a DNG converter that you can find in your Nikon Camera Applications CD and convert your pictures.
    You can also download ViewNX from here: http://www.nikonusa.com/en/Nikon-Products/Product/Imaging-Software/NVNX/ViewNX.html#tab-Pr oductDetail-ProductTabs-Overview

  • Hello! Newbie with PROBLEMS! Audio recording majorly DELAYED?!?!?!??  help?

    Hello there! I LOVED Logic 7, was very happy to get Logic 8. Then I installed Leopard. Now Logic is F'ed up. At first I had the Coremidiserver not responding issue. I deleted those MIDI drivers as well as Reason and my Melodyne rewire and bridge plugins. But when I want to do an Audio recording, Logic freezes, I get the rainbow death wheel for 60 seconds, and THEN it starts recording. It is really bad for creativity to have to wait to get the audio track to record. Does anyone know what could be going on or how I can fix it? I am using an Mbox2. I have the Line6 Toneport, but that is not working although it works for my boyfriend who has the same computer, logic 8 and leopard. I'm confused!!! what should i do? Can genius bar help me? Sorry for sounding neurotic, I'm just really anxious to make music an d not have all these technical issues! Thank you VERY VERY much for any advice.

    Are you recording to a macBook Pro internal hard drive? or to an external drive?
    How much memory do you have?. The delay of 60 sec before recording is not normal. Your computer is checking something else, or is forced to do another task before executing the command of recording
    logic 8 need a lot of memory the absolute minimum is 1 GB of Ram but 2 GB or more is highly recommended.
    best of luck
    Eric D

  • Newbie with Sockets. Speed problem

    Hi. I am newbie with Sockets. I have read java socket tutorials and wrote these two classes. The client tries to transfer file of 13MB to the server. This is done in internal network. Client and Server use 100Mb network cards. The problem I have is speed of transfer. It takes 4-5 sec to transfer this file.
    13MB * 8 / 5sec = 20Mb/s
    It seems slow to me considering that network cards are 100Mbit. I would expect to get at least 50-70Mb/s. It is my home network and noone else is using it.
    So, what I am doing wrong?
    public class Client {
    public Client() {
    public static void main(String[] args) {
    try {
    FileInputStream in1 = new FileInputStream("c:\\Documents and Settings\\Pavel\\jbproject\\untitled1\\src\\tryw\\test.txt");
    InetAddress addr = InetAddress.getByName("server");
    Socket s = new Socket(addr, 5000);
    OutputStream out = s.getOutputStream();
    BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream()));
    System.out.println((new Date(System.currentTimeMillis())).toString());
    byte[] buffer1 = new byte[1024];
    int g;
    while ((g=in1.read(buffer1))!=-1 ) {
    out.write(buffer1);
    System.out.println((new Date(System.currentTimeMillis())).toString());
    s.close();
    System.out.println((new Date(System.currentTimeMillis())).toString());
    }catch(Exception e){System.out.println(e.getMessage()); }}}
    public class Server {
    public Server() {
    public static void main(String[] args) {
    ServerSocket s = null;
    try {
    s = new ServerSocket(5000);
    while (true) {
    StringBuffer buffer = new StringBuffer();
    // Wait for a connection request from a client
    System.out.println("Waiting");
    Socket clientConn = s.accept();
    InputStream in = clientConn.getInputStream();
    OutputStream out = clientConn.getOutputStream();
    PrintWriter outp = new PrintWriter(out, true);
    BufferedReader inp = new BufferedReader(new InputStreamReader(in));
    String inputLine = null;
    Date date = new Date(System.currentTimeMillis());
    System.out.print(date.toString());
    while ((inputLine = inp.readLine()) != null) {
    buffer.append(inputLine);
    if (inputLine.equals("Bye."))
    break;
    Date date1 = new Date(System.currentTimeMillis());
    System.out.println(date1.toString());
    System.out.println(buffer.length());
    }catch(Exception e){System.out.println(e.toString());try {s.close();}catch(Exception he) {}}}}

    you probably want the buffering to occur under the PrintWriter, not the other way around, ie the buffering should be closest to the raw socket.
    You can bump up the size of the Buffering in the ctor, that might help.
    You can also gulp bigger blocks on the read.

  • How use system.out.println with a Java Swing Applet?

    Hi guys,
    I was just wondering what can I use to view output on the Java console with a Java Swing Applet?
    At the moment I'm using a JTextArea within the Applet for debugging but I want output to appear in the browser java console but system.out.println doesn't work.
    I'm viewing the Swing Applet on Netscape 4.7 browser.
    Any ideas?

    System.out.println()s work fine! I'm guessing that your problem is that you are looking at the wrong console window!
    You're using the Java Plug-in, right? On Windows, go to your Control Panel and double click "Java Plug-in". You should find a checkbox option to "Show Java Console" - make sure this is checked. Next time you fire up you JApplet, you should see a Java Console window popup.
    Hope this helps!

  • Newbie with a Motif ES8 - optimum setup with a minimalistic approach?

    hi,
    I'm trying to decide on the optimum setup with a minimalistic approach!
    I a newbie with the Motif ES8 and am at cross roads deciding on the type of computer setup for my VST.
    PC + Cubase vs. MAC + Logic Pro or Logic Pro Express?
    With MAC, how far do I need to go;i.e. MACBook Pro a must?
    how many USB ports (types 400 vs 800), etc?
    With Logic Pro, is Express going to be sufficient for a full soup to nuts recording and mastering given that this is for a home studio setup though with an idealist running it?
    I'm a one woman show and so don't need too many inputs/outputs. I'd be recording a track at a time and my songs take up less than 16 tracks.
    I would really appreciate any and all responses.
    Roya
    macbook pro   Mac OS X (10.4.7)  

    thanks for the detailed response PK
    so, the extra USB port on the HD would facilitate a
    hub type interface i.e. once you hook up another\
    device to the HD via USB, you're really hooked up to
    the computer.. right? and so, if I get a powered USB
    Hub, this wouldn't really matter.. correct?
    For the most part, you have to be careful hooking
    too many devices up to a computer WHEN you are trying
    to do some sound work. When they say a computer
    can do ABC we sometimes think that should include D.
    As for the sound interface, I already have an
    Audiophile that has midi in/out, firewire to
    computer, RCA jack for i/o. I know its not the high
    end stuff but I hope to do a stepwise upgrade here if
    at all possible..
    That actually might work, if it supports at least
    16 bit 44.1 khz that is the lowest you want to go.
    Ideally it should be 24 bit to take advantage of Logics
    24bit environment. You might be able to run the ES8
    straight into those RCA jacks if they are SPDIF and your
    keyboard has the same on the back.
    There are a bunch of people on Motifator discussion
    groups that warn against Apple's lack of support for
    Logic. Not sure if the concern is only regarding the
    combination of Yamaha (Motif) and Apple (Logic).
    I went and read that thread, here are some of my thoughts
    on some of this.
    Can't comment on MAC, but a dear friend of mine who is an audio engineer said >he had walked away from Logic after Apple bought them out. "Straight downhill" >I think is how he put it.
    Many windows users just hate Apple and their products.
    I think much of it is ignorance. They will say
    Macs are junk but when I ask them why
    they never have an answer or say something
    that is false. It sounds like this "professional"
    did not even wait to see that Logic did get better.
    Apple charges 200.00 for support of it's Professional
    applications. You really do not need it since there are
    so many experienced Logic users here that I never had
    a question go unanswered. I've noticed on those forums
    the same small group of people do most of the problem
    solving. I am not overly impressed with Yamaha's support.
    I had my questions about my keyboard answered quicker
    by those forums. So I guess both companies need work
    in this area. Frankly, for recording, I think the Motif
    and Logic are a Killer combination. Both have steep
    learning curves but once you get up to speed I think
    the results speak for themselves. The main difference
    in my opinion is that the Motif is the ultimate
    performance tool and Logic is the ultimate studio toolshop.
    After having a Motif for over a month, I am convinced
    it has a steeper learning curve than Logic take for instance
    that thread on getting your keyboard to record it's own
    audio output. The list of things to do each time is as long
    as my arm. In case you did not read it here it is.
    First thing – STORE your MIX setup and SAVE the Song to SmartMedia (or USB mass storage device) before resampling it so you have a backup. You would create a mix to balance the instruments the way you like them.
    * Select a target track, then press the [INTEGRATED SAMPLING] button.
    Setup the parameters for resampling:
    * Press [F1] DEST
    * Select a TRACK and [KEYBANK] (note) into which you will record the resampled data. You can target either an empty track or the track on which you are going to play (if you are going to play along). If all tracks are full, don't worry, you can still resample anyway.
    * Press [F2] SOURCE. Set the source parameters as follows:
    - Type = Sample - with this type the Integrated Sampling Sequencer will not create any NOTE-ON data in your sequencer, it will just simply add a new sample waveform to the waveform list
    - Source = Resample
    - Mono/Stereo = Stereo
    - Next = OFF
    - Frequency = 44.1k
    * Press [F6] REC This will place the sampling sequencer in Standby mode. Set the TrggrMode paramter to Manual
    * Press Start on the sequencer and check your levels. If too low set the REC GAIN higher +6bB or +12dB, if the level is to high (clipping- you will see a lightning bolt) lower the GAIN to -6dB or -12dB. When you have checked the levels, press STOP and return to the top of the SONG.
    * Press F6 REC to start the Resample, Press [>] (play) to begin recording the resample. The Motif ES will draw the wave as it samples.
    * When the song is over press [F6] STOP. The Motif ES will take a few moments to gather the data.
    To create the .wav file:
    * Press [FILE]
    * Press [F1] CONFIG
    * Press [SF1] CURRENT
    * If you will be saving the resampled song to a SmartMedia Card set the Current parameter to CARD. To save to a USB device, set this parameter to USB
    * Press [F2] SAVE
    * Set the data TYPE field to WAV
    * Cursor down and Name the wave
    * (If desired, navigate to the subdirectory where you want to save the *.wav file.)
    * Press [ENTER]
    * The ES will ask you which TRACK and NOTE to save as a wave file. Enter the values you selected as the sample destination in the procedure above.
    * Press and hold the AUDITION button to make sure your sample is there.
    * Press [ENTER] and the Motif ES will export the sample as a .wav to your SmartMedia card or USB device.
    Once you have configured Logic which are takes about
    3 minutes (and only has to be done once)
    and set up the keyboard which takes 30 seconds.
    (this has to be done once for each session)
    you plug your keyboard into your audio interface then
    Hit Record
    that is the whole list, two words.
    Once it is in Logic, you have many way to edit it
    and process if needed. The midi is much
    easier to manipulate and there are more
    ways than the ES has keys. Plus you can add to the
    sounds with the internal instruments which are
    as sophisticated and as high quality as the ES.
    Then if your happy with it you can create MP3's
    and burn Red book compliant CD's for
    commercial duplication.
    It really is a complete setup.
    But at any rate I'm going to do some more research on
    another scenario, i.e. what about MAC and Cubase? As
    you may know Yamaha just acquired Cubase..
    I dont think I would be the best to comment on that.
    Maybe ask one of the Gurus on the unofficial
    website for Cubase, The Cubinator.
    Sorry, I just couldn't resist.
    you've been very helpful - thanks again
    cheers,
    Roya
    Cheers!
    P.S. I agree with Dave, If you have a Macbook
    Pro you dont need another computer. If you
    wanta desktop whatever reasons I understand
    Oh and btw, what's QWERTY?
    They are the first 6 keys (top row/left to right)
    on your computer keyboard

  • Yes another user with problem with Apple Mobile Device Support, I am getting the error message: Service 'Apple Mobile Device'(Apple Mobile Device) failed to start. Vertify that you have sufficient privileges to start system service....

    Yes another user with problem with Apple Mobile Device Support, I am getting the error message: Service 'Apple Mobile Device'(Apple Mobile Device) failed to start. Vertify that you have sufficient privileges to start system service....I hit retry and it came up again. I hit ignore and it prompted me to hit finish so Itunes can open.   I looked thru alot of these posts on here to try and resolve this problem myself but it's not working too well...I downloaded Itunes to my desktop so I can right click it with the program i downloaded called WinRAR. I extracted it and then went into the folder called Itunes64setup. I saw the file called AppleMobileDeviceSupport64 in there so I began to try and download it on it's own. Well that didn't work as I planned and got this error message:
    Apple Mobile Device Support wasn't installed on your computer. The installer encountered errors before Apple Mobile Device Support could be configured. Your system has not been modified. To retry these operations at a later time,please run the installer again.
    Well I tried to run it again and came up with the same message...I see that some people got great support to help them so I am hoping someone can help me as well. I know "b nor" is very qualfied and hopefully can help me! Please advise what I can do. Thank you

    Hi Iss9243,
    Welcome to the Support Communities!
    You've already tried some great troubleshooting steps, but the article below gives you quite a few more for this issue.  Hope it helps ....
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Cheers,
    - Judy

  • If pdf generated with Bullzip, opens with problems in text (missing, weird characters, etc...)

    pdf opening in new tab shows problems with text. If pdf was generated with Adobe acrobat, works fine. If pdf generated with Bullzip, opens in new tab, but with problems.

    hello lwhitman, the pdf preview in firefox is still under very active development. if you find any issues please report them at https://github.com/mozilla/pdf.js/issues & provide a sample pdf-file which shows the problem.

  • ADF with BC4J and swing

    I created a sample with a pure swing client and using ADF UI designer, I drag-dropped a view object as a Table in the Swing UI. Note I am not using JClient, i am using Swing.
    When I run the application, I get:
    java.lang.NullPointerException
    at oracle.jbo.uicli.jui.JUPanelBinding.bindUIControl(JUPanelBinding.java:808)
    at com.churchill.temp.view.Frame1.jbInit(Frame1.java:37)
    at com.churchill.temp.view.Frame1.<init>(Frame1.java:22)
    at com.churchill.temp.view.Application1.<init>(Application1.java:13)
    at com.churchill.temp.view.Application1.main(Application1.java:50)

    Hi,
    I installed JDeveloper 11.1.1.3.0 and cracked the nut. The LOV driven ComboBoxes in JTables will remain empty after migrating to the new version, but it seems to be merely a bug in the migration. What you need to do in order to get the ComboBoxes working is the following:
    I found out that in your PageDefs you need to add two attributes to the <combobox> definitions:
    ControlClass="javax.swing.JComboBox" Editable="false"
    This makes the ComboBoxes look like in previous releases. If you skip the "Editable" attribute, the user can type in values, which does not really work in LOVs but in static lists.
    Unfortunately I experienced another bug in the 11.1.1.3.0 release concerning LOVs: When defining the LOV in the ViewDef, JDeveloper wouldn't let you specify any additional columns to be displayed in the LOV ("Display Attributes"). -> The workaround is much easier than I first thought: Just resize the dialog a little bigger and the selection fields that I first missed appear!
    In the moment it looks to me like I could continue development with JDeveloper 11.1.1.3.0.
    Mathias
    Edited by: user7585671 on 05.05.2010 06:26

  • I Am Using iphone 5 black 16 gb with problem of battery expansion in a year.?

    i Am Using iphone 5 black 16 gb with problem of battery expansion in a year.?

    What is your question?

  • HT1933 Good all, is there anyone with problem on the whatsapp 2.11.6 version. It's was crashing on my iPhone. I thought these software was first tested before uploading.

    Good all, is there anyone with problem on the whatsapp 2.11.6 version. It's was crashing on my iPhone. I thought these software was first tested before uploading.

    Looking at the reviews for the current version of the app in the app store it looks like other people are also having problems with it - you could try contacting the developers of the app : http://www.whatsapp.com/contact/

Maybe you are looking for

  • Need info on OPEN HUB SERVICES

    Hi Experts, I have a requirement where i have to extract data from an Standard Sales Overview  infocube(0SD_C03) and store it on a file server.From the file server need to push the file into MATRIX Database on a daily basis(Delta Load).The file needs

  • WVC80N Video Stream not displaying on iOS6 browsers

    I updated an iPhone and iPad to iOS6 yesterday.  Now my Linksys WVC80N video streams will not display on both Safari and Chrome browsers.   On Safari if I go to the Camera "Home" page then use the browser Back button to the View Video page then I can

  • Problems with SMTP

    I have just changed my ISP and my email address. I hit a problem I encountered before but never solved. Now that I have 2 email addresses it wouldn't accept the regular SMTP address for the new mail which is mail."myisp".com.au After discussions with

  • Bluetooth and keyboard system preferences not working

    Hi all, When I try to change the keyboard system preferences or the bluetooth system preferences, the 'application' locks up (Doesn't bring up any details, force quit gets out of it). I've tried leaving it for ages to see if it eventually opens but i

  • Ecatt-log export rfc

    Hi, I have some problems with my logfile-export and hope, that you can help me. I`m using a java-application to execute some transactions in ecatt. so, now i have the log-files. My problem is, with which function can i export the log file to my java