What component Should I use?, Jpanel doesn't work

Hi
I need a program that has a window that can go fullscreen and windowed (I did that with a Jframe in fullscreen mode with a jpnale and a 800x600 Jpanel and destroying them with an object that maneges them), I did it with a jframe that contained a Jpanel, I used a Jpanel to avoid the flickering on the screen but I also need to change the font type and the font size, but the setFont on the Jpanel doesn't change the font (as I have realized and also read here [http://forum.java.sun.com/thread.jspa?forumID=257&threadID=150588] ), so I'm lost, I might have to redo the whole thing, but I just wanted to know what component should I use for a window that is going to have custom graphics and need diffrent fonts and diffrent font sizes and work in fullscreen without flickering
Thank you for your attention, I would aprecciate any help given

for example:
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
public class JPanelFont extends JPanel
  private Font font = getFont();
  private String myString = "Fubars Rule";
  private int fontSize = font.getSize();
  private JSlider slider = new JSlider(0, 100, fontSize);
  public JPanelFont()
    setPreferredSize(new Dimension(620, 250));
    setLayout(new BorderLayout());
    JPanel inputPanel = createInputPanel();
    add(inputPanel, BorderLayout.SOUTH);
  private JPanel createInputPanel()
    JPanel ip = new JPanel();
    slider.setMajorTickSpacing(20);
    slider.setMinorTickSpacing(5);
    slider.setPaintTicks(true);
    slider.setPaintLabels(true);
    ip.add(slider);
    slider.addChangeListener(new ChangeListener()
      public void stateChanged(ChangeEvent evt)
        fontSize = (Integer)slider.getValue();
        repaint();
    return ip;
  @Override
  protected void paintComponent(Graphics g)
    Graphics2D g2 = (Graphics2D)g;
    Object originalHint = g2.getRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING);
    g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
    super.paintComponent(g2);
    myPaint(g2);
    g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, originalHint);
  private void myPaint(Graphics2D g2)
    font = font.deriveFont(Font.BOLD, fontSize);
    g2.setFont(font);
    g2.drawString(myString, 20, 100);
  private static void createAndShowUI()
    JFrame frame = new JFrame("Dynamic JPanel Font");
    frame.getContentPane().add(new JPanelFont());
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
  public static void main(String[] args)
    java.awt.EventQueue.invokeLater(new Runnable()
      public void run()
        createAndShowUI();
}Edited by: Encephalopathic on May 21, 2008 9:18 PM

Similar Messages

  • What Component should be used to display the list on UI

    Hi All,
    I have a table in which when the user selects a row and tries to remove the row. I am supposed to show the pop up which shows all the rows matching to the header of the row.
    In my backing bean i have the context of the row so i could extract the matching rows form db into a List<String> . Now what i need to know is which component on the Ui will show this as a list in Pop Up.
    I mean which component af:??? should be used to display the List ?
    I am kind of new to ADF.
    Regards,
    Sharma

    inputComboboxListOfValues
    selectOneChoice
    inputListOfValues

  • What app can I use adoleflash doesn't work

    Need help tried to view some web site but the aldobe flash player doesnt support so what can I use

    IOS device do not support Flash
    However Skyfire, Photon, iSwifter, Browse2Go and Puffin Web Browser will provide limited Flash capability

  • I feel I must move beyond iMovie, what program should I use ?

    I have been happily using iMovie and iDVD from versions 1 through 6.  iMovie 08 was so bad that Apple made iMovie 06 available as a free download for buyers of iMovie 08. The newer iMovies were better, but they seemed “dumbed down” (even for me).  Now, I am shocked and horrified to learn that the latest iMovie does not even set chapter markers!
    So, I have continued to use iMovie 06 and iDVD 08 (they seem to work fine under OS 10.9.4).   iMovie 06 is now 8 years old!  I feel compelled to move forward. A lot of my work is DV.    In the past, most of my source material came out of S-Video.   I used a Canopus ADVC300 analog-to-digital converter that gave good results.   Going forward, I will have more video utilizing Component Video, or HDMI.
    I am looking into 2 possibilities,  Adobe Premiere elements 12, or.........Final Cut Pro X.
    The final result of my work is almost always a DVD.   It is hard for me to move from iMovie and iDVD.  I never read the manuals for either program, yet,  I was able to produce DVDs with nice menus and overall quality close to Hollywood.
    It looks like Final Cut Pro X 'can' make a DVD directly without other software.  However, from what I have seen on YouTube the result is primitive compared to what iDVD was doing 10 years ago.
    Adobe Premiere elements 12 can make nice DVDs and Blu-ray's directly.  I have no problem with using a separate program to make DVDs but I haven't got a clue how to do that with Final Cut Pro X.   I suppose I can still use iDVD, but now I'm back to using discontinued software.
    I do not need any of the high-powered affects capability that Final Cut Pro X  possesses.  My “movie-making” is mostly confined to simple editing (the old iMovie 06 did all I needed).
    Frankly, one motivation for choosing Final Cut Pro X, is the excellent, compassionate and understanding support that the kind people on this very forum provide.  So, what program should I use?

    Ziatron wrote:
    ...  I am shocked and horrified to learn that the latest iMovie does not even set chapter markers!
    .. I am looking into 2 possibilities,  Adobe Premiere elements 12, or.........Final Cut Pro X.
    The final result of my work is almost always a DVD. ...
    ... I do not need any of the high-powered affects capability that Final Cut Pro X  possesses.  My “movie-making” is mostly confined to simple editing (the old iMovie 06 did all I needed).
    to turn perspective for a second by 180°:
    Why do you want to switch to a new editor anyhow?
    • iM-a never did discs - that was iDVDs job = no big change in your workflow
    • iDVD is still working, and aside obsolete, complex and $$$$ DVDSP (part of obsolete FC/p) or Encore (part of Adobes CC rent package) your only option left to create disks on MacOS is indeed iDVD (...ok, there's Toast and Burn and some weird 'shareware'-stuff...)..
    • iMovie-b supports the new HDef formats (AVCHD) - you mentioned converters and DVDs = no HDef in use, in your habitat, correct?
    • if you don't need FCPX' bling-bling (I can't imagine that ) - why not using FCPX-lite = iMovie? 15$ ...
    • chapters could be done in iDVD - just to mention that ............
    • AP and FCPX are following very different concepts in usage - my personal preference is 200% on FCPX, … I was one of the loudest nay-sayers, when iM08 araised, meanwhile, FCPX is my dream!! AP (tested it) is way too complex, crowded, 'optionalized' and did I mention 'complex' for me. A bit like Windows vs. MacOS: 'everything goes' (incl. getting lost) vs. 'convenience' (incl. restrictions) ... After 2y of practice, I'm editing my weekly hobby-projects with 6-cam-Multicam, incl. tons of  custom graphics, slow-mow, effects (soccer games) in less than 2h ... awesome!
    summary:
    • why switching?
    • use iMovie10 + iDVD
    • Premiere (or Premiere Elements!) and FCPX are both avail as fee trial ... test  it - but you need iDVD anyhow
    • 'disks'  is a dwindling niché, for years!- consider to switch to 'other' distribution options
    ... what are 'chapters' anyhow??... (kid din'!)

  • What query should I use to find all versions of Office 2013 64-bit installed on client computers?

    What query should I use to find all versions of Office 2013 64-bit installed on client computers? Could someone create a custom query? I need all of the client computers names and which ones have any Office 64-bit components. Thank you so much! I really
    appreciate it!

    Hi,
    You could edit the following query to meet your requirement.
    SELECT     dbo.v_R_System.Name0, dbo.v_GS_OPERATING_SYSTEM.Caption0 AS [Operating System],
                          dbo.v_GS_OPERATING_SYSTEM.CSDVersion0 AS [OS Service Pack], arp.DisplayName0,
                          CASE WHEN arp.version0 LIKE '11.0.6361.0' THEN 'SP1' WHEN arp.version0 LIKE '11.0.7969.0' THEN 'SP2' WHEN arp.version0 LIKE '11.0.8173.0'
    THEN 'SP3' WHEN
                           arp.version0 LIKE '12.0.6215.1000' THEN 'SP1' WHEN arp.version0 LIKE '12.0.6425.1000' THEN 'SP2' WHEN arp.version0 LIKE '14.0.6029.1000'
    THEN 'SP1' ELSE '' END
                           AS 'Service Pack', arp.Version0
    FROM         dbo.v_Add_Remove_Programs AS arp INNER JOIN
                          dbo.v_R_System ON arp.ResourceID = dbo.v_R_System.ResourceID INNER JOIN
                          dbo.v_RA_System_SMSInstalledSites AS ASSG ON dbo.v_R_System.ResourceID = ASSG.ResourceID INNER JOIN
                          dbo.v_GS_OPERATING_SYSTEM ON dbo.v_R_System.ResourceID = dbo.v_GS_OPERATING_SYSTEM.ResourceID
    WHERE     (arp.DisplayName0 LIKE '%Microsoft Office%edition%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Standard 2007%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Enterprise 2007%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Professional%2007%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Standard 2010%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Enterprise 2010%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Professional%2010%' OR
                          arp.DisplayName0 LIKE 'Microsoft Office 2000%' OR
                          arp.DisplayName0 LIKE 'Microsoft Office XP%') AND (arp.DisplayName0 NOT LIKE '%update%') AND
                          (arp.DisplayName0 NOT LIKE '%Microsoft Office XP Web Components') AND (dbo.v_R_System.Operating_System_Name_and0 NOT LIKE '%server%')
    AND
                          (arp.InstallDate0 NOT LIKE 'NULL')
    ORDER BY dbo.v_R_System.Name0, arp.DisplayName0, arp.Version0
    Full details:http://social.technet.microsoft.com/Forums/systemcenter/en-US/7baeb348-fb63-4115-8d76-2c884d18f708/sql-query-to-check-ms-office-service-pack-level?forum=configmgrreporting
    Best Regards,
    Joyce
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • My new iPad air is suddenly asking for a pass code. I have only just finished restoring it from my iPad 2 and I didn't set one. The one I used before doesn't work. What can I do?

    My new iPad air is asking for a pass code. I have only just finished restoring it via iTunes from my ipad2 and I didn't set one. The one I used before doesn't work. What can I do?

    http://support.apple.com/kb/HT1212

  • After upgrading from Mavericks to Yosemite I can no longer find in Mail the icon (looks like the Add To Contacts icon without the   mark) I used to press in order to obtain an e-mail address from my contact list. What procedure should I use now in or

    After yesterday upgrading from Mavericks to Yosemite I can no longer find in Mail the icon (looks like the Add To Contacts icon without the + mark) I used to press in order to obtain an e-mail address from my contact list. What procedure should I use now in order to quickly add an address to an e-mail that I wish to send?
    Bob

    On the right of the To: field you will see a circled plus sign:
    Click it.

  • I want to format my hard drive so i can have files bigger than 4GB what format should I use?

    I have a new hard drive that I want to format so it will work with both mac and PC (windows) but I have files that are bigger than 4GB, what format should I use?
    It needs to work with both PC and mac because I need to go between two computers etc

    If both of these computers are connect to the same router, both are in your home or place of work (Both are in the same location), it is very easy to Network them so you don't have to use DropBox or the external drive to share files between them.
    MickAUS2012 wrote:
    yea thanks for that,  i have drop box so i use that for some of my smaller files. Im just new to the mac so this is all a learning experince thanks for all your help everyone!

  • What setting should I use for Abbey Road drums?  Getting a cpu overload issue

    What setting should I use for Abbey Road drums (i.e. multi-output, stereo, etc)?  Getting a cpu overload issue.  I have a macbook pro, 4 gb ram, running Logic Pro 9.  Just 3 tracks of drums and a few real instrument tracks.  Can't find a guide in the manual for either Kontakt or Logic.  Thanks in advance!

    Hi
    AR drums are complete resource (CPU) hogs. They work better if you turn off as many of the AR internal plugins as you can.
    See section 4 (?) of the AR manual, which you can find within Kontakt (In the library area of Kontakt click hold the small "i" on the right of the "AR drummer" Library).
    Alternatively, your only solution is to increase the I/O buffer in Preferences:Audio, with the associated increase in latency
    CCT

  • What cable should I use to transfer data from an early 2008 MacBook to a new MacBook Pro?

    Just purchased a new MacBook Pro. Need to transfer data from my Early 2008 MacBook. What cable should I use?

    Firewire with a Thunderbolt.Firewire adapter.
    http://store.apple.com/us/product/MD464ZM/A/apple-thunderbolt-to-firewire-adapte r
    Ciao.

  • Everytime I try to enter something into the search box a further box appears to tell me this is a json file and what program should I use to open it. How can I

    I am using Linux mint 12 with firefox.
    Everytime I try to type something in the search box a further box appears to tell me this is a JSON file and what program should I use to open it.
    This has only happened since reinstalling my system a couple of weeks ago.
    I am not really interested in what a json file is I simply want to get rid of this pop up box.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    See also:
    *[[/questions/921535]]

  • I want to clean all of the cookies and bugs that are in my computer causing it to be slow. What program should I use that is safe and won't mess up my computer?

    I want to clean all of the cookies and bugs that are in my computer causing it to be slow. What program should I use that is safe and won't mess up my computer?

    Problem description:
    I would like to clean up my computer. Its beginning to run slow and I believe cookies and bugs are apart of the reason.
    EtreCheck version: 2.0.6 (91)
    Report generated October 26, 2014 at 4:59:31 PM EDT
    Hardware Information: ℹ️
      MacBook Air (13-inch, Early 2014) (Verified)
      MacBook Air - model: MacBookAir6,2
      1 1.4 GHz Intel Core i5 CPU: 2-core
      4 GB RAM Not upgradeable
      BANK 0/DIMM0
      2 GB DDR3 1600 MHz ok
      BANK 1/DIMM0
      2 GB DDR3 1600 MHz ok
      Bluetooth: Good - Handoff/Airdrop2 supported
      Wireless:  en0: 802.11 a/b/g/n/ac
    Video Information: ℹ️
      Intel HD Graphics 5000 -
      Color LCD 1440 x 900
    System Software: ℹ️
      OS X 10.9.5 (13F34) - Uptime: 13 days 2:41:41
    Disk Information: ℹ️
      APPLE SSD SD0128F disk0 : (121.33 GB)
      S.M.A.R.T. Status: Verified
      EFI (disk0s1) <not mounted> : 210 MB
      Macintosh HD (disk0s2) /  [Startup]: 120.47 GB (70.38 GB free)
      Recovery HD (disk0s3) <not mounted>  [Recovery]: 650 MB
    USB Information: ℹ️
      Apple Internal Memory Card Reader
      Apple Inc. iPhone
      General USB Flash Disk 16.13 GB
      S.M.A.R.T. Status: Verified
      MSD (disk1s1) /Volumes/MSD : 16.13 GB (11.18 GB free)
      Apple Inc. BRCM20702 Hub
      Apple Inc. Bluetooth USB Host Controller
    Thunderbolt Information: ℹ️
      Apple Inc. thunderbolt_bus
    Gatekeeper: ℹ️
      Mac App Store and identified developers
    Kernel Extensions: ℹ️
      /Library/Extensions
      [loaded] foo.tap (1.0) Support
      [loaded] foo.tun (1.0) Support
    Startup Items: ℹ️
      tap: Path: /Library/StartupItems/tap
      tun: Path: /Library/StartupItems/tun
      Startup items are obsolete and will not work in future versions of OS X
    Problem System Launch Daemons: ℹ️
      [failed] com.apple.wdhelper.plist
    Launch Daemons: ℹ️
      [loaded] com.adobe.fpsaud.plist Support
      [running] com.perion.searchprotectd.plist Support
    User Launch Agents: ℹ️
      [loaded] com.genieo.completer.download.plist Support
      [loaded] com.genieo.completer.ltvbit.plist Support
      [running] com.genieo.completer.update.plist Support
      [loaded] com.google.keystone.agent.plist Support
      [invalid?] com.jdibackup.ZipCloud.autostart.plist Support
      [running] com.zeobit.MacKeeper.Helper.plist Support
    User Login Items: ℹ️
      iTunesHelper Application (/Applications/iTunes.app/Contents/MacOS/iTunesHelper.app)
    Internet Plug-ins: ℹ️
      DirectorShockwave: Version: 12.1.3r153 - SDK 10.6 Support
      Flash Player: Version: 15.0.0.189 - SDK 10.6 Support
      FlashPlayer-10.6: Version: 15.0.0.189 - SDK 10.6 Support
      JavaAppletPlugin: Version: 14.9.0 - SDK 10.7 Check version
      QuickTime Plugin: Version: 7.7.3
      Default Browser: Version: 537 - SDK 10.9
    User Internet Plug-ins: ℹ️
      TroviNPAPIPlugin: Version: 1.0 - SDK 10.9 Support
    Safari Extensions: ℹ️
      Trovi Search for Safari (Disabled)
    3rd Party Preference Panes: ℹ️
      Flash Player  Support
    Time Machine: ℹ️
      Time Machine not configured!
    Top Processes by CPU: ℹ️
          53% mds
          9% WindowServer
          3% mds_stores
          3% storeagent
          2% hidd
    Top Processes by Memory: ℹ️
      920 MB mds
      31 MB com.apple.WebKit.WebContent
      30 MB Messages
      29 MB Safari
      21 MB WindowServer
    Virtual Memory Information: ℹ️
      31 MB Free RAM
      713 MB Active RAM
      681 MB Inactive RAM
      1.09 GB Wired RAM
      17.85 GB Page-ins
      1.95 GB Page-outs

  • I would like to create a document with imbedded video, to email, and airdrop to an iPad mini. What program should I use?

    I would like to create a document with imbedded video, to email, and airdrop to an iPad mini. What program should I use?

    Thank you for using the Apple Support Communities
    I would suggest using Apple's Pages which allows support for imbedding videos from the device's camera roll. Pages also allows for sharing via email, Air Drop, and Messages.

  • What program should I use and various??

    Hi friends,
    I have two questions:
    1) So I have finished my project...how do I fit it onto one dvd? Quicktime conversion??
    2) What program should I use to burn to dvd? I have a macbook.
    3) How do I make chapters on the dvd??
    Thank you so much for assisting

    1. Export a QuickTime Movie. Do NOT use QT Conversion. Import the resulting QuickTime file into the DVD creation program. Don't worry about file size at this point. The DVD authoring application will compress and encode. You can fit about two hours of video on a single-layer DVD.
    2. The simplest method is to use iDVD which probably came with the MacBook.
    3. Playing the FCE Timeline, press M twice, name the chapter if you wish and click the Add Chapter Marker button in the resulting window. Then when you export, make sure to choose to include Chapter markers in the Export window. Within iDVD, I think you can also set iDVD to include a chapter marker at set intervals, but not at specific points.
    Not to be snarky, but that seems like three questions...
    Good luck.

  • What program should i use to archive my photos ?

    what program should i use to archive my photos ? i have tried aperture and the mage browsing program that comes with canon, but i just cant find the right program to be fast and efficent ! any suggestions ?

    " work for a news paper so i have a large amount of photos coming and going in my system, so i need a program that is faster and more efficient that aperture"
    I believe you are looking for a lightweight image browser/viewer that supports basic editing. I highly recommend Lyn and believe it is the exact program for your purposes. It is $20, but you are offered a free 30$ trial.
    http://www.lynapp.com
    And for a review:
    The Best Photo Management App for Mac OS X - Lifehacker

Maybe you are looking for

  • Sound to come out on my television

    I have a new 13 in mac book pro, i bought a mini dvi to dvi and then the dvi to hdmi, the screen is perfect but the sound still comes out through the laptop and not the television, how do i make the sound come out through the screen

  • Deactivating Delivery Group Creation in VL10c

    Hi, We are using VL10c for creating deliveries for a list of sales orders. I choose background option in VL10c. When we do this, system is creating group numbers for the deliveries which we don't want. We actually do create the groups in VL06o before

  • Illustrator is snapping to point without the option selected.

    Illustrator is snapping to point without the option selected. Anyone else noticing this and what is the solution. Yes I have restarted illustrator.

  • Pass parameters from hbj link

    Hi,     I want to pass parameters from hbj link to the component where the event method is going to be called. And also when I click the event how it is going to redirect other jsp. Regards, Suresh.B

  • Cut and paste not working on linux?

    Hi, I am a beginning user of Jdeveloper. I noticed that I can cut and paste to and from my windows applications to my Jdev on linux, but is unable to cut and paste from emacs or xterm to and from Jdev on the same linux box. Is there a simple configur