Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7947285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:23:18+00:00 2026-06-04T01:23:18+00:00

I am writing a application for manipulating a custom sqlite DB. DB is quite

  • 0

I am writing a application for manipulating a custom sqlite DB.
DB is quite complicated, it has tree like structure.

main
--->operator1
------>name
------>address
--->operator2
------>name
------>address
------>tariffs
---------->name
---------->price

I need to have something like a ‘path’ in order to easily browse through the table and edit stuff… My data is organized as SWT Table. I have SWT.MouseDoubleClick listener attached to it. I intent to ‘step into’ my operator data by double clicking on a particular table row. The problem is, how to get back to the ‘main view’, I need some sort of navigation for that purpose.
My current idea is to create a container and add necessary buttons into it. Similar to

nautilus

Notice, the path is created as consecutive buttons, aligned horizontally:

mentis -> Dropbox -> Photos

The big question is how to do that 😉

I am able to create a button and add it to may container, however this works only when application starts. I don’t know how to add buttons to my container when the app is running.

In my main class I have sth like this:

    Composite pathBarContainer = new Composite(shell, SWT.BORDER);
    pathBarContainer.setSize(shell.getBounds().width, 20);
    pathBarContainer.setLayout(new FillLayout(SWT.HORIZONTAL));
    GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gridData.horizontalSpan = 3;
    pathBarContainer.setLayoutData(gridData);

    pathBar = new PathBar(pathBarContainer, shell, contentProvider);
    pathBar.getPathBar();

this is my PathBar class:

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;

public class PathBar {

Composite parent;
Composite pathBar;
Shell mainShell;
ContentProvider contentProvider;
Button mainButton;
Button nextButton;

public PathBar(Composite parent_in, Shell mainShell_in, ContentProvider cp) {

    parent = parent_in;
    mainShell = mainShell_in;
    contentProvider = cp;


    pathBar = new Composite(parent, SWT.BORDER_DOT);
    //pathBar.setSize(100, 300);
    pathBar.setLayout(new GridLayout(10, true));

    mainButton = new Button(pathBar, SWT.PUSH);
    mainButton.setText("main");

}

public Composite getPathBar() {



    return pathBar;
}

public void addMainButton() {
    mainButton = new Button(pathBar, SWT.PUSH);
    mainButton.setText("main");
    pathBar.redraw();
    //parent.redraw();
    //mainShell.redraw();
}

public void addButton() {
    nextButton = new Button(pathBar, SWT.PUSH);
    nextButton.setText("sth");
    pathBar.redraw();
    parent.redraw();
    System.out.println("addButton");
}
}

Methods addMainButton() and addButton() are supposed to be run from eventHandler… attached to my SWT table…

How to solve this ?
Pls help 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T01:23:20+00:00Added an answer on June 4, 2026 at 1:23 am

    You need to tell it to redo your layout after you add buttons.

    pathBar.layout(true);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Writing an application for a custom gallery, and all the script files are put
i'm writing application like social network where in my application can show status update
I'm trying to view some 3d geometry in a custom ipad application I'm writing.
Im writing an application that supposed to send coordinates in an SMS, but I've
When writing an application to support scalability, how do I decide whether to support
I'm writing an application and I'm able to set its throughput (the number of
I am writing Windows application (with Borland C++ Builder), which stores large number of
I am writing an application in java (1.6) using swing. I currently have a
I'm writing an application that will create difficult passwords for the user. The user
I'm writing an application that interacts with other processes on a x64 Vista machine.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.