Solved

JSlider on Applet

Posted on 2010-11-13
7
869 Views
Last Modified: 2012-05-10
Hello,

 
public void init() {
      Container content = getContentPane();
      content.setBackground(Color.white);
    content.setLayout(new BorderLayout());
    JPanel panel = new JPanel();
 panel.add(textField);
  //  panel.add(slider);
    panel.setBackground(Color.white);
    addButtons(panel);
    panel.add(stepButton);
    panel.add(resetButton);
    panel.add(slider);
    add(panel, "North");
}

Open in new window


  I'm trying to add a JSlider component to java applet. Its not visible on load . when I click on the component its visible again. I tried everything.

I have a background color for the panel which is not visible.
I'm attaching the snaps and code . The class extends JApplet

-Abhi


 image1
 image2
0
Comment
Question by:abhi376
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 92

Expert Comment

by:objects
ID: 34128937
that code looks ok, problem appears like its elsewhere in your code
0
 
LVL 6

Author Comment

by:abhi376
ID: 34128969
I just intialized the slider. I'm not even using it anywhere. Does awt components and swing components togther in a jpanel cause problem ??
0
 
LVL 92

Expert Comment

by:objects
ID: 34128977
yes they can, best not to mix them
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 6

Author Comment

by:abhi376
ID: 34129007
why is the panel background color now showing up ? I set the panel background color to be grey.
0
 
LVL 92

Expert Comment

by:objects
ID: 34129021
add:

panel.setOpaque(true);
0
 
LVL 6

Accepted Solution

by:
abhi376 earned 0 total points
ID: 34134260
It will worked with JApplet and panel. Again Jpanel here messes the things up
0
 
LVL 6

Author Closing Comment

by:abhi376
ID: 34171340
I figured the problem
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
spring jars download 1 68
maven module vs maven project 3 116
Using jdbcTemplate.batchUpdate to improve INSERT performance 6 34
IBM TS2900 (3572) Tape Autoloader Java? 12 109
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn different types of Android Layout and some basics of an Android App.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question