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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:00:43+00:00 2026-06-13T08:00:43+00:00

So I am creating a image to place in the title area. Everything works

  • 0

So I am creating a image to place in the title area. Everything works with the exception that only a 1/4th of the image is displayed?

my image is actually text and a image combine in one image EX: JKTeater [ ] <– icon
so right now only JKT is showing in the title area

Here is the create() method

public void create() {
  super.create();
  setTitle("JKTeater Application");
  setMessage("Hello World");
  if (image != null) setTitleImage(image);

}
  1. Is there a specific size that the title area code allows for?
  2. Is there a way to place the end of the image at the end of the title area?
  3. Can you use a layout to move it around?
  4. How can I get a black horizonal line at the bottom of the title area?

EDIT

enter image description here

I am sure that it would be asking to much to see if you can actually change the background color from a basic color to a gradient

  • 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-13T08:00:44+00:00Added an answer on June 13, 2026 at 8:00 am

    Here is an example TitleAreaDialog. As you can see, the Image is completely shown and aligned to the right:

    public static void main(String[] args) {
        final Shell shell = new Shell();
        shell.setLayout(new FillLayout());
    
        TitleAreaDialog dialog = new MyTitleAreaDialog(shell);
        dialog.setTitleAreaColor(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND).getRGB());
        dialog.open();
    }
    
    private static class MyTitleAreaDialog extends TitleAreaDialog
    {
        private Image image;
    
        public MyTitleAreaDialog(Shell parentShell) {
            super(parentShell);
            image = new Image(Display.getDefault(), "/home/baz/Desktop/StackOverflow.png");
        }
    
        @Override
        public boolean close() {
            if (image != null)
                image.dispose();
            return super.close();
        }
    
        @Override
        protected Control createContents(Composite parent) {
            Control contents = super.createContents(parent);
    
            setTitle("Title");
            setMessage("Message");
    
            if (image != null)
                setTitleImage(image);
    
            return contents;
        }
    
        @Override
        protected Control createDialogArea(Composite parent) {
            Composite composite = (Composite) super.createDialogArea(parent);
    
            // YOUR LINE HERE!
            Label line = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
            line.setLayoutData(new GridData(SWT.FILL, SWT.END, true, true));
    
            return composite;
        }
    }
    

    enter image description here

    Is there a specific size that the title area code allows for?

    AFAIK there are no restrictions to the size. I tried using an Image that was larger than my screen resolution and it was fully displayed. The Dialog was obviously unusable though.

    I am sure that it would be asking to much to see if you can actually change the background color from a basic color to a gradient

    The background color can be changed using dialog.setTitleAreaColor(RGB) (in this case the widget background color), but you cannot use a gradient. There is a deprecated method getTitleArea() which would return the title area Composite, but I really wouldn’t recommend using that.

    How can I get a black horizonal line at the bottom of the title area?

    The line at the bottom was achieved by using:

    Label line = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
    line.setLayoutData(new GridData(SWT.FILL, SWT.END, true, true));
    

    Can you use a layout to move it around?

    There is a similar question here:

    Moving an image of a TitleAreaDialog to the left

    The answers there explain how to change details of the TitleAreaDialog. Maybe read up on them.

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

Sidebar

Related Questions

I am creating an Image Processing app that does two image analysis functions. One
I am creating a web page, where I have an image that I want
I am creating an image slider and only 2 images are displaying at a
the tutorial here http://www.edumobile.org/android/android-beginner-tutorials/creating-image-gallery/ teaches how to put images from resources in gallery here's
I am creating an image (some sort of copy of another gallery image) using
I am creating an image dynamically using php. The image is being created if
I have been creating an image gallery with jQuery, all is done. The images
I'm currently having trouble creating an image from a binary string of data in
When creating a new Image element in javascript, Google Chrome's memory tool (Developer tools
I am creating a transparent image on iOS using Quartz. However, this image shows

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.