Trying to change JFrame at eof

Hello, very new to the community and to Java. My question is....I have created two JFrames, one to enter data and one to read two different files depending on user choice once they input their data. I would like for the JFrame to change the title once it reaches the end of the first file and starts reading the next. For example, the user clicks "view files" to display each file in the "blue" data file one at a time (meanwhile, the title reads "blue file") and once the "Blue" file reaches the end, it displays the "red" file data. This is when I want the title on the JFrame to switch to read "red file". I have completed the application already, so everything is being written and read. I only need to change the title. I don't need exact code or anything, I just need to know whi ch method to use to do this. Thanks for replies.
I have tried adding "JLabel title = new JLabel("Red List");" in my try catch block, don't laugh, but it was worth a try right?

So you've looked through the JFrame API and you've searched on the term "title" and nothing came up?

Similar Messages

  • Trying to change the color of a single cell

    hi, I am trying to change the color of a single cell when mouse moves over it, but couldn't do it. i even tried my own renderer, but it doesn't work. can anybody help ?

    Here is what I am trying to do. I am displaying some data in a java JTable retrieved from a table in database. What is needed is when user moves his mouse over any cell in the third column, the cursor should change to hand cursor and possibly the background color should also change, to indicate the user that this cell is clickable. I have to show some other report when user clicks any cell in column three. The code follows as
    import java.awt.*;
    import java.sql.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.sql.rowset.*;
    import javax.swing.table.*;
    public class MouseMotionInTable extends JFrame
    public static void main(String[] args)
      MouseMotionInTable f = new MouseMotionInTable();
      Toolkit tk = Toolkit.getDefaultToolkit();
      Dimension dim = tk.getScreenSize();
      int w = dim.width;
      int h = dim.height;
      f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      f.setBounds((w-600)/2, (h-300)/2, 600, 300);
      f.setVisible(true);
    MouseMotionInTable()
      Connection con = null;
      CachedRowSet crs = null;
      try
       Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
       con = DriverManager.getConnection("jdbc:odbc:FMS", "", "");
       Statement st = con.createStatement();
       String query = "SELECT ItemName, Alias, ItemReOrderQuty, ItemMeasure FROM ItemInfo";
       ResultSet rs = st.executeQuery(query);
       crs = new com.sun.rowset.CachedRowSetImpl();
       crs.populate(rs);
       st.close();
      catch (SQLException e)
       e.printStackTrace();
      catch (ClassNotFoundException e)
       e.printStackTrace();
      finally
       if(con != null)
        try
         con.close();
        catch (SQLException e)
         e.printStackTrace();
      DBTableModel model = new DBTableModel(crs);
      table = new JTable(model);
      JPanel center = new JPanel();
      center.setLayout(new BorderLayout());
      center.add(new JScrollPane(table), BorderLayout.CENTER);
      add(center, BorderLayout.CENTER);
      table.addMouseMotionListener(new MouseMotionAdapter()
       public void mouseMoved(MouseEvent me)
        int col = table.columnAtPoint(new Point(me.getX(), me.getY()));
        int row = table.rowAtPoint(new Point(me.getX(), me.getY()));
        if(col == 2)
         Object val = table.getValueAt(row, col);
         boolean isSelect = table.isCellSelected(row, col);
         boolean focus = table.isCellSelected(row, col);
         TableCellRenderer cellRender = table.getCellRenderer(row, col);
         Component comp = cellRender.getTableCellRendererComponent(table, val, isSelect, focus, row, col);
         comp.setCursor(new Cursor(Cursor.HAND_CURSOR));
         comp.setBackground(Color.yellow);
    private JTable table;
    class DBTableModel extends AbstractTableModel
    ResultSet rs;
    ResultSetMetaData rsMeta;
    DBTableModel(ResultSet rs)
      try
       this.rs = rs;
       rsMeta = rs.getMetaData();
      catch(SQLException e)
       e.printStackTrace();
    public int getColumnCount()
      try
       return rsMeta.getColumnCount();  
      catch(SQLException e)
       e.printStackTrace();
      return -1;
    public String getColumnName(int c)
      try
       return rsMeta.getColumnName(c+1);
      catch(SQLException e)
       e.printStackTrace();
      return "";
    public int getRowCount()
      try
       rs.last();
       return rs.getRow();
      catch(SQLException e)
       e.printStackTrace();
      return -1;
    public Object getValueAt(int r, int c)
      try
       rs.absolute(r+1);
       return rs.getObject(c+1);
      catch(SQLException e)
       e.printStackTrace();
      return "";
    public boolean isCellEditable(int r, int c)
      return false;
    public Class getColumnClass(int c)
      return getValueAt(0,c).getClass();
    }

  • How we can change JFrame Border Color Not Background.

    How we change jframe border color not background
    if any body know about that then plz tell me
    at this [email protected]
    i m thanksfull to ..... .

    hi Shafr
    beleive it or not, i got it using trial and error. i keep
    trying words in the function setStyle until the color changed. i
    dont know why it is not documented.
    var periodBarColor:SolidColor = new
    SolidColor(taskSchedColorChooser.selectedColor, 1);
    periodBar.setStyle("fill",periodBarColor);
    //where taskSchedColorChooser is colorPicker component. you
    can replace it by any color you want

  • I do not have the 'Advanced' tab on the menu bar. I am trying to change ringtone on my iphone 4s. Have done the following: Right cick on song, entered the start and stop times, but unable to proceed as need 'Advanced' tab in order to change to option.

    I do not have the 'Advanced' tab on the menu bar. I am trying to change ringtone on my iphone 4s. Have done the following: Right cick on song, entered the start and stop times, but unable to proceed as need 'Advanced' tab in order to change to option.

    You don't need to upgrade your software.  But if you're struggling with Spry, IMO you should cut your losses and switch to something better for the longrun.
    If you have a budget to work with, I highly recommend Project Seven's Pop-Menu Magic 3.  It's easy to use in DW CS4, 5, 6 or CC.  More importantly, it's bullet proof and works in all devices. 
    Pop-Menu  Magic3 by PVII (commercial DW extension)
    http://www.projectseven.com/products/menusystems/pmm3/index.htm
    If you don't have a budget to work with, you can roll your own menus with jQuery plugins.  A bit more effort on your part, but they perform better than Spry.
    jQuery Superfish
    http://users.tpg.com.au/j_birch/plugins/superfish/
    jQuery MegaMenu2
    DEMO:
    http://www.geektantra.com/projects/jquery-megamenu-2/
    DOWNLOAD:
    http://code.google.com/p/jquery-megamenu/
    Nancy O.

  • Trying to change the Tab size of SQL Server 2008 R2 ?

    Been trying to change the size of the tab but it just doesnt change!
    Went to Tools-Options-Text Editor-Transact-SQL
    From 2 to 1. 
    Any ideas? 

    Hi Shavendra,
    The Options dialog box lets you change the default behavior of the Database Engine Query Editor while you are programming Transact-SQL scripts. To display these settings, click Options on the Tools menu, expand the Text Editor folder, expand the Transact-SQL
    subfolder and then click Tabs.
    Tab size: Sets the distance in spaces between tab stops. The default is four spaces.
    Reference: http://msdn.microsoft.com/en-us/library/bb895215.aspx.
    Thanks,
    Maggie
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.

  • Crashes after trying to change font in score window

    Hi,
    I'm having a weird problem with Logic 7.1 in my powerbook 1.33. When trying to change a font in score edit window, Logic crashes imediatly. It happens in the "Text Styles" window as well. When you click in a font name, it's gone!
    Any ideas? Running in the latest Tiger with 1Gb RAM. Also, is it a problem to keep Logic 6.4 installed on the same machine?
    Thanks everybody!

    Do you use another machine for that task?
    as a matter of fact i do, although my G4 will run classic. and LP7 is os x only, you need an older version of logic that runs in OS 9. logic won't run in classic mode.
    to save your file, i suggest taking it to someone with os 9 and an old version of logic. in fact, if you emailed it to me i could do it. someone on this forum suggested buying an older machine with USB (or getting a USB card) just for such emergencies. i have retained my old G3 powerbook with logic 5.5. it has a PCMCIA USB card on it so i can put in my XSkey.
    having to do this is stupid though. let's see, to fix this logic score display bug, we have to buy an old computer that can boot up in classic, open and resave the corrupted song in that. what a ridiculous work around.
    when I open older socres created on my previous mac-printer setup, it's all messy, dynamics, articulations and text (not to mention the wrong fonts).
    yet another reason we need some logic score updating action. the reason your score looks funny will be due to the fact that you probably resized your score using page setup - ie using your printer driver. the correct way to do this is by opening the instrument set display box and resizing there.
    fonts not being displayed will be down to whatever fonts you have available in your system, so if you do not have the fonts available then they cannot be displayed. another reason your display will look strange, particularly in terms of where your articulations and dynamics are placed in the score may have to do with how you inserted them in the first place. in logic, you have to be very careful to insert your dynamics, articulations etc on the correct stave (it will be highlighted blue when you select the object) and in the correct midi position. check to see if they are in your messy score by selecting the object (ie dynamic articulation or whatever) and opening the event editor. is it where it should be?
    another trick if the display is completely screwed in logic 7 is to cut an object at a barline. (though obviously not in the middle of a note). this forces logic to recalculate the score display.
    my advice if you want to have soft copies of previous scores is to create pdf's of them. i almost never print directly from logic (unless i am in a terrible rush), i create pdf's first. that way you won't run in to the display problem. you can do this easily in os 9 if you have laserwirter 8 selected in chooser. you can then save to file and choose acrobat pdf.
    let me know if you want me to rescue your logic song that won't open.

  • HT5625 My daughter and I were both on same Apple ID. We are trying to change hers but when we do, it says her email is already associated with an Apple ID but when we try to get the password, it says that it could not be verified. How do we correct this?

    My daughter and I were both on same Apple ID. We are trying to change hers but when we do, it says her email is already associated with an Apple ID but when we try to get the password, it says that it could not be verified. How do we correct this?

    Not from your end. Click here and ask the iTunes Store staff for assistance.
    (126716)

  • HT201303 I tried to change my email address on the apple ID but now when I try to buy an app or film it still comes up with my old email address and won't accept  my password to buy anything. My old email address is no longer in use  and can not be access

    I tried to change my email address ID , but now when I try to buy an app or music it still shows my old email address  and won't accept my password which I did not change. What can I do as I can't download anything ?

    What id shows in Settings > iTunes & App Store ? If it's the old one then tap on it and log out of it and then log in with the updated version

  • Error while trying to change or save as  query in query designer

    Hi ,
    When we are trying to change or do a save as to a query in the query designer,it is giving us an error stating"'An unexpected object variable or with block variable not set'error occured in wdbrlog 1 error(s) are logged".
    We have searched in SDN for the same error and found some OSS notes(Notes 571831,575434) should be implemnted but those notes seem old.We are using BI 7.0 version.
    Could anyone please suggest??
    Thanks,
    Bhagyarekha.

    What is your front end SP level ?

  • I am trying to change the email address associated with my existing account to free up my university email address for use in obtaining Creative Cloud.

    I am trying to change the email address associated with my existing account to free up my university email address for use in obtaining Creative Cloud.  Every time I go to the account settings of my existing account (which currently uses my university email, as I set it up years ago and had no idea it'd eventually cause problems), I enter a different email to use for that account but I continuously receive an error message saying "account changes cannot be saved."  It makes me think that it's because the email isn't verified (funny, it actually is verified since it has been the alternate email on the old account for years), but when I click the "send verification email" nothing happens (that is, no email is sent to that other email address).
    Anyway, my university is now requiring that faculty create new accounts using our university email addresses in order to register/use Creative Cloud.  Am I able to delete my old account, or can anyone help me actually change the email address associated with my old account without getting a "changes can't be saved" error?

    This is an open forum, not Adobe support... you need Adobe support to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"
    or
    Make sure that EVERY DETAIL is the same in every place you enter your information
    -right down to how you spell and punctuate the parts of your name and address
    Change/Verify Account https://forums.adobe.com/thread/1465499 may help
    -Credit card https://helpx.adobe.com/utilities/credit-card.html
    -email address https://forums.adobe.com/thread/1446019
    -http://helpx.adobe.com/x-productkb/global/didn-t-receive-expected-email.html

  • I am trying to change my Apple ID. Try to do this I keep getting an error message saying 'This email address is designated as your rescue email address and cannot be used as your Apple ID or Primary email address. Please choose another.' The email address

    I am trying to change my Apple ID. Try to do this I keep getting an error message saying ‘This email address is designated as your rescue email address and cannot be used as your Apple ID or Primary email address. Please choose another.’ The email address that I want to use did use to be my recovery email but I have changed it, so that address is no lonegr associated with my account. I do not understand why I cannot use it as my Apple ID now.  Can anyone help?

    Contact iTunes customer support for assistance.

  • HT5621 Trying to change the email on my apple ID but get error message that the email I want to change to is already used for notifications. What do I do?

    Hi,
    I'm trying to change email address on my Apple ID since the email registered for the account has been hacked and I can't access it anymore. The email I want to change to is connected to another Apple ID I created about 4 years ago, though I successfully changed the email on that account as well. So the email I would like to use for my main Apple ID shouldn't be "locked" anymore.
    Though, when trying to change the email on my Apple ID I get an error message (in Swedish, so this is a direct translate from google): "This e-mail address is your email address for notification. It can not be used as the Apple ID or primary email. Choose a different address."
    I'm not really sure what this means or how I can fix this. The email address is connected to my Ipad and Iphone for the email app, can that have anything to do with it?
    If it makes any difference, I updated both my Ipad3 and Iphone4 to ios 7 today. I'm trying to change from my Macbook air though.
    Please advise, would really appreciate a reply ASAP.

    caek1 wrote:
    Hi,
    I'm trying to change email address on my Apple ID since the email registered for the account has been hacked and I can't access it anymore. The email I want to change to is connected to another Apple ID I created about 4 years ago, though I successfully changed the email on that account as well. So the email I would like to use for my main Apple ID shouldn't be "locked" anymore.
    Though, when trying to change the email on my Apple ID I get an error message (in Swedish, so this is a direct translate from google): "This e-mail address is your email address for notification. It can not be used as the Apple ID or primary email. Choose a different address."
    I'm not really sure what this means or how I can fix this.
    It means exactly what it says... The email Address is in Use. You cannot re-use it.
    Apple ID Support  >  http://www.apple.com/support/appleid/

  • I'm trying to change my apple ID and it says it has been verified, but it still will not change on my phone, so I cannot access my iCloud or iMessage, what am I supposed to do to fix this problem?

    I have been trying to change my Apple ID for my iPhone account because the e-mail on there is an old e-mail that I cannot use anymore. I have went on the website and went through all of the steps of changing it, and I've changed everything to my updated e-mail and verified it as well. On my phone, it still has my old e-mail address, and keeps popping up any time I try to access iCloud, iMessage, etc. that my password or e-mail is invalid. I'm not sure why it's not changing on my phone or what other steps I'm supposed to take in changing it.

    If they are no longer in your camera roll, save them to your camera roll before deleting the account (open your my photo stream album, tap Select, tap the photos, tap the share icon -- box with upward pointing arrow, the tap Save to Camera Roll).

  • While trying to change a BOM with transaction CS02, a runtime error appears

    While trying to change a BOM with transaction CS02, a runtime error appears.
    In intial screen he entered material ,plant BOM usage and date valid from  after executed then id displayed item list in that he wantu2019s delete one item, he has been deleted selected item after that when he was saving he is getting runtime error
    Developer trace
    ABAP Program SAPLKED1_WRITE_CE4_BPS1                 .
    Source LKED1_WRITE_CE4_BPS1U01                  Line 30.
    Error Code SAPSQL_ARRAY_INSERT_DUPREC.
    Module  $Id: //bas/640_REL/src/krn/runt/absapsql.c#17 $ SAP.
    Function HandleRsqlErrors Line 775.
    RABAX: level LEV_RX_STDERR completed.
    RABAX: level LEV_RX_RFC_ERROR entered.
    RABAX: level LEV_RX_RFC_ERROR completed.
    RABAX: level LEV_RX_RFC_CLOSE entered.
    RABAX: level LEV_RX_RFC_CLOSE completed.
    RABAX: level LEV_RX_IMC_ERROR entered.
    RABAX: level LEV_RX_IMC_ERROR completed.
    RABAX: level LEV_RX_DATASET_CLOSE entered.
    RABAX: level LEV_RX_DATASET_CLOSE completed.
    RABAX: level LEV_RX_RESET_SHMLOCKS entered.
    RABAX: level LEV_RX_RESET_SHMLOCKS completed.
    RABAX: level LEV_RX_ERROR_SAVE entered.
    RABAX: level LEV_RX_ERROR_SAVE completed.
    RABAX: level LEV_RX_ERROR_TPDA entered.
    RABAX: level LEV_RX_ERROR_TPDA completed.
    RABAX: level LEV_RX_PXA_RELEASE_RUDI entered.
    RABAX: level LEV_RX_PXA_RELEASE_RUDI completed.
    RABAX: level LEV_RX_LIVE_CACHE_CLEANUP entered.
    RABAX: level LEV_RX_LIVE_CACHE_CLEANUP completed.
    RABAX: level LEV_RX_END entered.
    RABAX: level LEV_RX_END completed.
    RABAX: end RX_RFC
    In sm21
    Perform rollback
    Run-time error "SAPSQL_ARRAY_INSERT_DUPREC" occurred
         Short dump "090618 110101 donalda 11557 " generated
    Runtime Error          SAPSQL_ARRAY_INSERT_DUPREC
    Exception              CX_SY_OPEN_SQL_DB
           Occurred on     18.06.2009 at   11:01:01
    The ABAP/4 Open SQL array insert results in duplicate database records.
    What happened?
    Error in ABAP application program.
    The current ABAP program "SAPLKED1_WRITE_CE4_BPS1" had to be terminated because
    one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    What can you do?
    Print out the error message (using the "Print" function)
    and make a note of the actions and input that caused the
    error.
    To resolve the problem, contact your SAP system administrator.
    You can use transaction ST22 (ABAP Dump Analysis) to view and administer
    termination messages, especially those beyond their normal deletion
    date.
    Error analysis
    An exception occurred. This exception is dealt with in more detail below
    . The exception, which is assigned to the class 'CX_SY_OPEN_SQL_DB', was
    neither
    caught nor passed along using a RAISING clause, in the procedure
    "RKE_WRITE_CE4__BPS1" "(FUNCTION)"
    Since the caller of the procedure could not have expected this exception
    to occur, the running program was terminated.
    The reason for the exception is:
    If you use an ABAP/4 Open SQL array insert to insert a record in
    the database and that record already exists with the same key,
    this results in a termination.
    (With an ABAP/4 Open SQL single record insert in the same error
    situation, processing does not terminate, but SY-SUBRC is set to 4.)
    How to correct the error
    The exception must either be prevented, caught within the procedure
    "RKE_WRITE_CE4__BPS1"
    "(FUNCTION)", or declared in the procedure's RAISING clause.
    To prevent the exception, note the following:
    Use an ABAP/4 Open SQL array insert only if you are sure that none of
    the records passed already exists in the database.
    You may able to find an interim solution to the problem
    in the SAP note system. If you have access to the note system yourself,
    use the following search criteria:
    "SAPSQL_ARRAY_INSERT_DUPREC" CX_SY_OPEN_SQL_DBC
    "SAPLKED1_WRITE_CE4_BPS1" or "LKED1_WRITE_CE4_BPS1U01"
    "RKE_WRITE_CE4__BPS1"
    If you cannot solve the problem yourself, please send the
    following documents to SAP:
    1. A hard copy print describing the problem.
       To obtain this, select the "Print" function on the current screen.
    2. A suitable hardcopy prinout of the system log.
       To obtain this, call the system log with Transaction SM21
       and select the "Print" function to print out the relevant
       part.
    3. If the programs are your own programs or modified SAP programs,
       supply the source code.
       To do this, you can either use the "PRINT" command in the editor or
       print the programs using the report RSINCL00.
    4. Details regarding the conditions under which the error occurred
       or which actions and input led to the error.

    Hi ,
    you are getting beacuse u are trying to do mass update to database.
    Please check that below note are applicable to your system.
    Note 453313 - DBIF_RSQL_ERROR_INTERNAL for mass insert
    Note 869534 - AFS MRP doesn't work properly with all BOM item categories
    Thanks Rishi Abrol

  • I tried to change the file type of the movie, but now I am unable to open/edit it in iMovie, HELP !

    I tried to change the file type of the movie, but now I am unable to open/edit it in iMovie, HELP !

    Thank you very much! This is exactly what I was looking for.
    I appreciate your time and effort in solving my question : )

Maybe you are looking for

  • Using a DVI HDMI cable with my Sharp Aquos LC-52D62U 1080p

    Hello I have a Mac Mini Intel proc with 4GB RAM (max RAM). I'm trying to get it to work with my Sharp Aquos LC-52D62U 52" TV. The TV supports 1080p native, and the mini has had no issues connecting to this TV before. I just re-installed 10.6 (with al

  • How do I get bookmarks from 3.6.24 to 24.0

    Older mac 10.4.11 + firefox 3.6.24 does not have Sync. Using profile backup: I found and made a copy of bookmark-xxxx-xx-xx.json and loaded it to new mac. Firefox finds file but give an error message: "Varmuuskopiota ei voida käsitellä". Translation

  • How do I set up my air print

    How do I set up my printer do I need a separate app

  • I am getting error in primavera p6

    Hi, i am getting error" exception eout of memory in module pm.exe at 00027A32 out of memory" When the time of loading ,it is loading 98% and then it is giving error. I am using a sql Server. kindly any one can help me on this .

  • Mail attachments - office for example word- cannot be opened

    In my mail account (GoogleMail) in iPad Mail, I cannot open the attachments (office word) and see the content. The only thing I see is the icon "W" in blue and the name of the attachment ".doc" I cannot mark or open it. No conten menue appears. I hav