How to remove and add the component to JFrame at runtime.

Hi
How to delete the JTabbedPane component from the Jframe at runtime and how to add the same component with different data at runtime.
But the remaining components should not distrub.
When i try to delete and add the component at runtime the remaing components are distrubed.
when i minimize and maximize the screen, the components are adjusted. but i need a help on this without minimize and maximize the screen.

Hi
I am sending my code snippet, please look into this......i am doing the same even though i am not able to..................can u suggest anything seeing this code snippet.
here one function called createtabpane (It creates the JTabbedpanes with the table information at runtime).
private void getTimeSheetObj(String weekDate){
//Object[][] rowObj=null;
try {
System.out.println("Inside the gettimesheet method try block");
if(projTables!=null){
for(int i=projTables.length-1; i>=0; i--){
JTable jt = projTables;
jTabbedPane_Main.remove(jt);
System.out.println("Removing Table:"+i);
jPanel_Tabbedpane.remove(jTabbedPane_Main);
jTabbedPane_Main = new JTabbedPane();
jTabbedPane_Main.revalidate();
jPanel_Tabbedpane.revalidate();
getContentPane().validate();
getContentPane().repaint();
jTabbedPane_Main.addChangeListener(new ChangeListener(){
public void stateChanged(ChangeEvent ce){
getTabbedPaneListenerValues();
// this.setState(JFrame.ICONIFIED);
// this.setExtendedState(JFrame.MAXIMIZED_BOTH);
res = GetTimesheetResponseDocument.Factory.parse(new File("C:\\Narayana.xml"));
response = res.getGetTimesheetResponse();
proDets=response.getProjectDetailsArray();
numOfPro = proDets.length;
String taskDayValues[] = new String[8];
System.out.println(numOfPro);
proArr=new Object[numOfPro];
Object[][] taskValues=null;
for(int p = 0;p<numOfPro;p++){
System.out.println("Inside1");
taskDet = proDets[p].getTaskDetailsArray();
taskValues = new Object[taskDet.length][8];
for(int t=0;t<taskDet.length;t++){
System.out.println("Inside2");
taskValues[t][0] = (taskDet[t].getTaskName());
taskValues[t][1] = (taskDet[t].getDay1HH()+":"+taskDet[t].getDay1MM()).toString();
taskValues[t][2] = (taskDet[t].getDay2HH()+":"+taskDet[t].getDay2MM()).toString();
taskValues[t][3] = (taskDet[t].getDay3HH()+":"+taskDet[t].getDay3MM()).toString();
taskValues[t][4] = (taskDet[t].getDay4HH()+":"+taskDet[t].getDay4MM()).toString();
taskValues[t][5] = (taskDet[t].getDay5HH()+":"+taskDet[t].getDay5MM()).toString();
taskValues[t][6] = (taskDet[t].getDay6HH()+":"+taskDet[t].getDay6MM()).toString();
taskValues[t][7] = (taskDet[t].getDay7HH()+":"+taskDet[t].getDay7MM()).toString();
System.out.println("After taskvalues");
proArr[p]=taskValues;
createTabPanes(jTabbedPane_Main, proArr);
System.out.println("outside");
jPanel_Tabbedpane.add(jTabbedPane_Main);
jTabbedPane_Main.getAccessibleContext().setAccessibleName("Proj");
getContentPane().add(jPanel_Tabbedpane);
pack();
}catch(XmlException xe) {
System.out.println("Inside the XmlException block");
System.out.println(""+xe.getMessage());
} catch(IOException ioe) {
System.out.println("Inside the IOException block");
System.out.println(""+ioe.getMessage());
/* JOptionPane.showMessageDialog(null,
"Values Displayed in the below tables",
"Alert!",JOptionPane.ERROR_MESSAGE); */
System.out.println("Initial JFrame Bounds:"+this.getBounds());

Similar Messages

  • How to remove and change the color of Java cup and border

    Hi to all,
    How to remove and change the color of Java cup and border.
    Thanks in advance
    khiz_eng

    This is just an Image. You would need to create your own image and call setIconImage(Image) on your JFrame.

  • Satellite A30-921: How to remove and replace the memory?

    hi, can anyone help me how to remove and replace the memory of sat A30-921. and also, please give a detailed instruction.
    thank you in advance.

    Hi
    There is no much to explain. At the bottom side in the middle there is placed memory cover (fixed with two screws). Remove the cover and you will see 2 slots there. I dont know how much memory has you there but as Stefan said you can use max 2 GB of RAM (2x PC2700 1024MB - PA3313U-1M1G). How to remove memory modules you can see on http://www.hardwaresecrets.com/article/189/5
    Bye

  • How to remove and add plotted data?

    In my code below I would like to add two buttons and by clicking on a button("Remove") it will remove one by one plotted data,and plot it back by clicking on the button("Add") such as the examples:
    Full data plotted by running the class
    Now by a single click on a Remove button last data point disappear
    another click and again last data point disappear, and so on
    The inverse operation would be performed by clicking on "Add" button: each click will add back a data point
    import javafx.application.Application;
    import javafx.beans.property.SimpleDoubleProperty;
    import javafx.event.EventHandler; 
    import javafx.scene.chart.NumberAxis;
    import javafx.scene.chart.XYChart;
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.chart.LineChart;
    import javafx.scene.control.Button;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.BorderPane;
    public class XYMove extends Application {
    BorderPane pane;
    XYChart.Series series1 = new XYChart.Series();
    SimpleDoubleProperty rectinitX = new SimpleDoubleProperty();
    SimpleDoubleProperty rectX = new SimpleDoubleProperty();
    SimpleDoubleProperty rectY = new SimpleDoubleProperty();
    @Override
    public void start(Stage stage) {
    final NumberAxis xAxis = new NumberAxis(12, 20, 1);
    double max = 12;
    double min = 3;
    max *= (1+((double)3/100));
    min *= (1-((double)3/100));
    final NumberAxis yAxis = new NumberAxis(min, max, 1);
    xAxis.setAnimated(false);
    yAxis.setAnimated(false);
    yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis) {
        @Override
        public String toString(Number object) {
            return String.format("%2.0f", object);
    final LineChart<Number, Number> lineChart = new LineChart<Number, Number>(xAxis, yAxis);
    lineChart.setCreateSymbols(false);
    lineChart.setAlternativeRowFillVisible(false);
    lineChart.setAnimated(false);
    lineChart.setLegendVisible(false);
    series1.getData().add(new XYChart.Data(1, 3));
    series1.getData().add(new XYChart.Data(2, 8));
    series1.getData().add(new XYChart.Data(3, 6));
    series1.getData().add(new XYChart.Data(4, 7));
    series1.getData().add(new XYChart.Data(5, 5));
    series1.getData().add(new XYChart.Data(6, 6));
    series1.getData().add(new XYChart.Data(7, 4));
    series1.getData().add(new XYChart.Data(8, 7));
    series1.getData().add(new XYChart.Data(9, 6));
    series1.getData().add(new XYChart.Data(10, 7));
    series1.getData().add(new XYChart.Data(11, 6));
    series1.getData().add(new XYChart.Data(12, 7));
    series1.getData().add(new XYChart.Data(13, 6));
    series1.getData().add(new XYChart.Data(14, 12));
    series1.getData().add(new XYChart.Data(15, 10));
    series1.getData().add(new XYChart.Data(16, 11));
    series1.getData().add(new XYChart.Data(17, 9));
    series1.getData().add(new XYChart.Data(18, 10));
    pane = new BorderPane();
    pane.setCenter(lineChart);
    Scene scene = new Scene(pane, 800, 600);
    lineChart.getData().addAll(series1);
    stage.setScene(scene);        
    scene.setOnMouseClicked(mouseHandler);
    scene.setOnMouseDragged(mouseHandler);
    scene.setOnMouseEntered(mouseHandler);
    scene.setOnMouseExited(mouseHandler);
    scene.setOnMouseMoved(mouseHandler);
    scene.setOnMousePressed(mouseHandler);
    scene.setOnMouseReleased(mouseHandler);
    stage.show();
    EventHandler<MouseEvent> mouseHandler = new EventHandler<MouseEvent>() {
    @Override
    public void handle(MouseEvent mouseEvent) {
        if (mouseEvent.getEventType() == MouseEvent.MOUSE_PRESSED) {            
            rectinitX.set(mouseEvent.getX());
        else if (mouseEvent.getEventType() == MouseEvent.MOUSE_DRAGGED || mouseEvent.getEventType() == MouseEvent.MOUSE_MOVED) {
            LineChart<Number, Number> lineChart = (LineChart<Number, Number>) pane.getCenter();
            NumberAxis xAxis = (NumberAxis) lineChart.getXAxis();
            double Tgap = xAxis.getWidth()/(xAxis.getUpperBound() - xAxis.getLowerBound());
            double newXlower=xAxis.getLowerBound(), newXupper=xAxis.getUpperBound();            
            double Delta=0.3;
            if(mouseEvent.getEventType() == MouseEvent.MOUSE_DRAGGED){
            if(rectinitX.get() < mouseEvent.getX()&& newXlower >= 0){   
                newXlower=xAxis.getLowerBound()-Delta;
                newXupper=xAxis.getUpperBound()-Delta;
        else if(rectinitX.get() > mouseEvent.getX()&& newXupper <= 22){   
                newXlower=xAxis.getLowerBound()+Delta;
                newXupper=xAxis.getUpperBound()+Delta;
            xAxis.setLowerBound( newXlower );
            xAxis.setUpperBound( newXupper );                       
            rectinitX.set(mouseEvent.getX());                                
        public static void main(String[] args) {
            launch(args);
    }Thanks!

    I would use an ObservableList (probably backed by a LinkedList) of XYChart.Data to store the collection of "deleted" data points. Create the buttons as usual; your "Remove" button's event handler should remove the last element of the series and add it to the first element of the deleted items data points. The "Add" button should remove the first element of the deleted data points and add it to the end of the series. You can bind the "disable" property of the remove and add button to Bindings.isEmpty(series1.getData()) and Bindings.isEmpty(deletedDataPoints), respectively.
    Something like
    ObservableList<XYChart.Data<Number, Number>> deletedDataPoints = FXCollections.observableList(new LinkedList<XYChart.Data<Number, Number>>());
    removeButton.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
        deletedDataPoints.add(0, series1.getData().remove(series1.getData().size()-1));
    addButton.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
        series1.getData().add(deletedDataPoints.remove(0));
    removeButton.disableProperty().bind(Bindings.isEmpty(series1.getData()));
    addButton.disableProperty().bind(Bindings.isEmpty(deletedDataPoints));The other approach would be to use a separate List for all the data points, and keep an integer variable storing the number of data points displayed. Your "remove" button would decrement the number displayed, and your "add" button would increment the number displayed. Both would also call
    series1.getData().setAll(allDataPoints.sublist(0, numberOfDisplayedPoints));You might even be able to make the numberOfDisplayedPoints an IntegerProperty and bind the data property of the series to it in a nice way. This approach probably doesn't perform as well as the previous approach (using a stack of deleted points), because you are not directly giving the chart as much detailed information about what has changed.
    Both approaches get problematic (in the sense that you need to carefully define your application logic, and then implement it) if the underlying data has the potential to change.

  • How to remove and assign the subclsss in Migration.

    Hi All,
    I am migrating the form 6i appliaction form 6i to 10g with database as 9i.
    I am trying to migrate the form 6i files to 10g.
    I have get the referenced emb file (subclass file) from the database and made the Object library from this file. I have put the olb file in the registery path of the forms.After this I have open the form in the migration tool and migrate the form. I have done the changes according to the LOG file. But when I am opening the form it is not getting the subclass files so that it is asking the database connection.
    Can any body please advice me how to remove the subclss information at the time of migration from database to file so that after migration it will take the subclss refrence from the olb file.
    Can any body just advice how to migrate the forms 6i to 10g in steps OR any document, URL (Specially removing the referencce and taking the new reference from OLB)
    Thanks in advance.
    SUN
    Edited by: User SUN@ on May 13, 2010 4:31 PM

    Hi,
    Not eactly the same but there was a set of Forms that reference another Form for subclasses rather than the OLB. I've managed to sort that out using JDAPI and here is a sample bit of code. Basically , going through property classes and removing then and then adding the property classes object group from the OLB. It seemed to do the trick didn't upset the properties of the items using the class. It may be of help to you.
    There was no migration in this : just a fix on a Forms 10g module. I'd yes you could do the same, migrate to 10g and then use JDAPI to fix the form.
    HTH
    Steve
          for (JdapiIterator mods = Jdapi.getModules(); mods.hasNext(); ) {
             FormModule mod = (FormModule)(JdapiModule)mods.next();
             u.logger.info(mod.getAbsolutePath() + " " + mod.getTitle());
             for (JdapiIterator classes = mod.getPropertyClasses(); classes.hasNext(); ) {
                PropertyClass cls = (PropertyClass)classes.next();
                classes.remove();
             ObjectLibrary objLib = ObjectLibrary.open(p.getProperty(systemName + "pll.directory")+"/myapp.olb");
             for (JdapiIterator oTabs = objLib.getObjectLibraryTabs(); oTabs.hasNext(); ) {
                ObjectLibraryTab oTab = (ObjectLibraryTab)oTabs.next();
                if (oTab.getLabel().equals("Object Groups (Sub-Class these)")) {
                   for (JdapiIterator tabObj = oTab.getTabObjects(); tabObj.hasNext(); ) {
                      ObjectGroup objGrp = (ObjectGroup)tabObj.next();
                      if (objGrp.getName().equals("APP_PROPERTY_CLASSES")) {
                         ObjectGroup newObj = new ObjectGroup(mod, "APP_PROPERTY_CLASSES", objGrp);
                         u.logger.info(mod.getName() + " APP.OLB added in");
             objLib.destroy();

  • Powershell Script to Remove and Add the user with same permission

    Hi,
    I need to remove all users within all site collection of a web application and add them back with same permission level. We have a siteminder based custom trusted identity token issuer configured in our farm. The name of the issuer will be changed
    due to some architectural decissions , hence all users which are there before will be unidentified, hence need to be removed and added again.
    Currently each user looks like :                       c:0ǹ.t|Identity Token Issuer1|user1
    Post the change the user will look like:          c:0ǹ.t|Identity Token Issuer New|user1
    I am looking for a powershell script which can handle this operation.
    Thanks, Bivsworld

    Bivsworld,
    Below link should give you a start.
    http://www.sptechlearn.com/2014/10/delete-users-from-user-information-list.html

  • I have a power mac and the hard drive is about to die, i have a new hard drive to install, i know how to remove and put the old in the second space and load the new one, then what...when do reinstall the OS and transfer data from old drive

    I have a power mac, the hard drive is struggling, I have a new hard drive ready to install, after I pull the old one and put the new one it's place and place the old one in the next slot ready to transfer data....how do I start this next step.  Do I down load OS, and go to utililities...please just a step by step after hard drives in position.

    Hi Susan, you must have a Mac Pro, Powermacs cannot run 10.6.x
    Anyway, once you Install the new drive, you likely must Format it...
    How to format your disks...
    http://www.kenstone.net/fcp_homepage/partitioning_tiger.html
    (To Install OSX on an IntelMac the Drive it needs the GUID Partitioning scheme mentioned at the bottom.)
    Thanks to Pondini, Formatting,  Partitioning, Verifying,  and  Repairing  Disks...
    http://web.me.com/pondini/AppleTips/DU.html
    Then Install the OS & on first boot of the new install, after a step or two, avail yourself of Migration Assistant & Migrate everything.

  • How to download and install the legacy Java SE 6 runtime?

    After installing Yosemite, I get a message on startup to install the legacy Java SE 6 runtime. I click on the "more info" button to visit the legacy Java SE 6 download site, but the site does not load. What can I do?

    If you need to install Java legacy SE 6 runtime, first, you can try going to the website associated with the software (app) that you are trying to run and see if they have any support options.  If there is nothing available for you, you can try this link (it worked for me anyway):  users can download Java 6 here
    I was trying to run my Finale program (music notation software) for the first time after the Yosemite upgrade, and I got an error message that said I needed to install Java legacy SE 6 runtime.  After searching a few other places online with no success, I found this link on Finale's website (www.makemusic.com) and clicked on "FINALE," then "SUPPORT," then "SUPPORT SOLUTIONS" and I typed "Java legacy SE 6 runtime" into the search bar.  The #1 search topic that came up is titled, " Java 6 SE Update Required Message when launching Finale or PrintMusic."  After clicking on that, There was this link to install Java legacy SE 6 runtime: users can download Java 6 here
    If you click on that link, it will download the update.  You will then go to your downloads folder, click on the file, and then it will step you through all the usual installation prompts.  This link is trustworthy, so no worries there!  I hope this helps!

  • HT201628 How to remove and reinstall the Apple Mobile Device Spport on Windows

    my new iphone 5s cannot be recognized by itune
    I installed the newest version of itune
    The itune asked me to uninstall the apple mobile device support and intue
    because i need newer version of apple mobile device support
    I tried to uninstall the apple mobile device support
    but it still in the list of my programs and features
    Is there some other way to uninstall the apple mobile device support?
    thanks a lot

    Thanks, Tiinsky.  I followed your instructions (deleting the Apple Mobile Device Support folder under C:) \Program FIles\Common Files\Apple  and this seems to have done the trick.
    Incidentally, even after doing so, I was still unable to uninstall Apple Mobile Device Support through the control panel.  It would go three-quarters of the way through the process and then roll back the whole uninstallation. 
    However, removing those folders did allow me to successfully re-install iTunes--something I hadn't been able to do before. Previously, it would stall out and give me an error message reading "Service 'Apple Mobile Device' failed to start. Verify that you have sufficient privileges to start system services" with the choices Retry Abort Ignore--none of which worked.
    My operating system is Vista.

  • How do I find out who is attached to my sharing of my account and remove and add someone? Is 5 devices the limit?

    Devices sharing is 5?
    Where do I go to remove and add a devic

    Hey 1980justme!
    I have an article for you that can help you address this question:
    iTunes Store: Authorize or deauthorize your Mac or PC
    http://support.apple.com/kb/ht1420
    Thanks for coming to the Apple Support Communities!
    Regards,
    Braden

  • After the latest update, all my apple products reverted to an old icloud account.  As it no longer exists, I cannot get into it to delete it and add the correct id.  How can I change this, especially on my Macbook pro?

    After the latest update, all my apple products reverted to an old icloud account.  As it no longer exists, I cannot get into it to delete it and add the correct id.  How can I change this, especially on my Macbook pro?  There is no p/w related to it and even though I tried to reset "password" it won't allow as the id does not exist, neither does the email associated with the old id.  How do I switch it to a newer id?

    It's all rather odd because the old account cannot 'no longer exist' - if you don't have the correct password you won't be able to get into it, but you can't actually delete an iCloud account from the server.
    I'm afraid you will need the services of iCloud Support. If you currently happen to have AppleCare, either because you recently bought Apple hardware or have paid to extend the inititial period, you can contact them here:
    http://www.apple.com/support/icloud/contact/
    You will need the serial number of the covered hardware.
    If you are not covered by AppleCare, then - in common with other free email services - there is no free support and you may be asked to pay a fee.

  • I want to know what I need and then how to take a pdf form I created in word and add the blue boxes so that anyone can type into my form

    I want to know what I need and then how to take a pdf form I created in word and add the blue boxes so that anyone can type into my form

    Hey john@adobe,
    Could you please specify how exactly have you created your form.
    You might need to have Acrobat installed on your computer to convert a word document to PDF.
    Do you have Acrobat installed? If yes, what version? If no, then please try using the trial version of Acrobat DC (latest version) and access its features:
    Download Adobe Acrobat free trial | Acrobat Pro DC
    Also, let me know what kind of blue boxes are you talking about.
    If you want others to edit your PDF form, then you need to make it a fillable form by choosing 'Form Editing' option from Tools pane.
    Let me know more on this so that I can help you out.
    Regards,
    Anubha

  • How Do I create Windows Form file in VS and add the form to my VS project?

    C#, How Do I create Windows Form file in VS and add the form file to my VS project by using C# code?
    I like to create a Windows Form file into my VS Win Form project by using C#. I have the path and the file name.
    I need a Win Form with FileName.cs, FileName.Designer.cs, FileName.resx, and FileName (as you see it VS by adding a Win Form manually by using VS)
    Rune Brattas

    You cannot create a Form from code at run time. 
    For one thing, the user running your application will, almost certainly, not have  a copy of Visual Studio to hand with which to build anything.  (Not that you actually need 'Studio at all; Notepad and csc.exe are all you actually
    need), but that's another story).
    You can do this with an awful lot of pain, using the innards of the compiler from iside your own program, compiling the new Form's source code on the fly and then executing the resulting assembly within your application.  IMHO, that's a simply terrifying
    prospect especially as the code you will be compiling will be on someone else's machine and over which you will have absolutely no control.  If you're lucky, they'll spell something wrong and it won't compile.
    The "usual" way to do this sort of thing is to create additional, "plug-in" forms as library assemblies and have your program load and execute these at run-time. 
    Regards, Phill W.

  • How to unlock the request for a report and add the same query to new reques

    hi,
         how to unlock the request for a  and add the same query to new reques

    You can unlock in SE03 tcode.
    Goto tcode SE01, give the transport number --> display --> double click on the transport --> in the next screen select all the elements --> delete --> save.
    To attach it to another transport, In RSA1, click on transport connection> Choose Object types> query elements --> here you can find your query/ or you can search, which you can drag to right and attach to the transport (using truck button).

  • HT2129 i remove and disturb the reinstall software, how can i fix it

    I remove and disturb the Reinstall software when installing, and now my computer has freezes, how can i fix it?

    It says " application failed because MSVCR80.dll is missing from computer and then when I click okay it says I tunes wan't installed correctly Please reinstall
    Many thanks, that's perfect. Try the following user tip with those ones:
    Troubleshooting issues with iTunes for Windows updates

Maybe you are looking for