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 8225691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:29:59+00:00 2026-06-07T15:29:59+00:00

I want use WPF on Windows version of my java application. I found it

  • 0

I want use WPF on Windows version of my java application. I found it is easy to do it with SWT and it is also supporting wpf ResourceDictionary XAML for SWT elements (please see this). SWT WPF implementation working well for me but I couldn’t find out how I can put WPF theme on it. Some of SWT widgets same org.eclipse.swt.widgets.Button have setData method but some of them like org.eclipse.swt.widgets.Display have not that method. Also setDate method on shell will not set theme on entire window.

So how can I put a theme for entire window of my SWT WPF program?

Here is a sample code:

import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MenuItem;

public class MainForm {

    protected Shell shell;

    public static void main(String[] args) {
        try {
            MainForm window = new MainForm();
            window.open();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void open() {
        Display display = Display.getDefault();
        createContents();
        shell.open();
        shell.layout();
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch()) {
                display.sleep();
            }
        }
    }

    protected void createContents() {
        shell = new Shell();
        shell.setData(
                "ResourceDictionary",
                "ExpressionDark.xaml");
        // theme not applied on entire window, just buttons

        shell.setSize(450, 300);
        shell.setText("Window Title");

        Button button = new Button(shell, SWT.FLAT);
        button.setText("Button");
        button.setSize(250, 50);
        button.setBounds(0, 50, 250, 50);

        Menu menu = new Menu(shell, SWT.BAR);
        shell.setMenuBar(menu);

        MenuItem mntmNewSubmenu = new MenuItem(menu, SWT.CASCADE);
        mntmNewSubmenu.setText("New SubMenu");

        Menu menu_1 = new Menu(mntmNewSubmenu);
        mntmNewSubmenu.setMenu(menu_1);

    }
}
  • 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-07T15:30:00+00:00Added an answer on June 7, 2026 at 3:30 pm

    SWT WPF is no longer supported. So it is better to not be used.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use WPF windows in a legacy win32 application. I'd like to
I am implementing WPF Application and i want to use System.Windows.Automation Namespace to capture
I want to use WPF windows in future applications instead of Windows forms. The
I want to use in my wpf aplication notify icon (with .dll library in
I am starting a project from scratch in WPF using SQLite.I want to use
I want use JQuery mobile for the front-end of my mobile application, but I
I want to develope my first real WPF Desktop Application. It's quite a lot
I am displaying Mac Address in a WPF application. I want that mac address
I'm trying to embed Windows-Sidebar-Widgets into my own .Net Application (WPF and C#), but
I have a WPF windows application that uses the ms ribbon control for the

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.