panel

Zooming in and zooming out within a panel

穿精又带淫゛_ 提交于 2019-11-29 03:17:42
问题 I have a Panel in which some 2D objects are moving about. I have overridden paintComponent() as necessary. Now I want to be able to zoom in and zoom out that area. When zooming in, scrollbars will appear by which one can view the entire field by scrolling. While zooming in and out, the 2D objects should increase or decrease in size accordingly. Which Swing component or rather combination of components will help to achieve this? 回答1: Easiest way is to modify your panel and introduce a double

Extending a pandas panel frame along the minor axis

江枫思渺然 提交于 2019-11-29 01:57:54
问题 I would like to extend a Panel frame of data along a minor axis in pandas. I start off creating a dic of DataFrame s to generate a Panel. import pandas as pd import numpy as np rng = pd.date_range('1/1/2013',periods=100,freq='D') df1 = pd.DataFrame(np.random.randn(100, 4), index = rng, columns = ['A','B','C','D']) df2 = pd.DataFrame(np.random.randn(100, 4), index = rng, columns = ['A','B','C','D']) df3 = pd.DataFrame(np.random.randn(100, 4), index = rng, columns = ['A','B','C','D']) pf = pd

How do you add a scrollbar to a Panel control with many controls in windows form application?

早过忘川 提交于 2019-11-29 01:20:12
问题 How do you add a scrollbar to a Panel control with many controls in windows form application? 回答1: Just set the AutoScroll property of your Panel to true and it will handle adding the scrollbars for you. this.panel1.AutoScroll = true; 来源: https://stackoverflow.com/questions/730376/how-do-you-add-a-scrollbar-to-a-panel-control-with-many-controls-in-windows-form

Simple Gnome Panel Applet in Python

不打扰是莪最后的温柔 提交于 2019-11-28 22:58:13
问题 When I'm on the train to work I connect my netbook to my Nexus One's wifi hotspot. As I go through a tunnel my phone obviously loses it's 3G connection and takes a while to re-establish once the train emerges. But the netbook wifi logo stays constant as it's still connected to the phone itself. I've written a little python program that attempts to ping a server and thus decides if internet is available (feel free to suggest a method of detecting internet connection that would be either

java TrayIcon using image with transparent background

♀尐吖头ヾ 提交于 2019-11-28 18:20:05
I am using the following code to set a tray icon in Windows and Linux. It works wonderful in Windows and works okay in Linux. In Linux (Ubuntu) I have my panel set to be (somewhat) transparent and when I add a GIF (with a transparent background) the background of the icon shows up all grey and ugly (see image, green diamond "!")....Any ideas on how to make the GIF image I am adding "keep" its transparent background? alt text http://unarm.org/stackoverflow/panel_task.jpg and the image I am using, if you'd like to test: alt text http://unarm.org/stackoverflow/green_info.gif import java.awt.*;

Saving Panel to PDF not working nor getting errors

人盡茶涼 提交于 2019-11-28 14:39:25
I am trying to save a panel to pdf using ITextSharp . When I set a breakpoint and debug, the code stops on this line of code, however it does not give an error and just stops. if (IsPostBack) { Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=Quote.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); **Panel1.RenderControl(hw);** StringReader sr = new StringReader(sw.ToString()); Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 100f, 0f);

Java Swing Card Layout change the displayed Panel?

扶醉桌前 提交于 2019-11-28 14:28:30
so I have this jFrame with a Panel. Inside that panel there are two more panels and the layout is set to cards. Inside one of those two panels there is a button. How can I change the panel thats being displayed when that button is pressed? Try this code snippet, hope the comments might help you understand the sequence. import java.awt.*; import java.awt.event.*; import javax.swing.*; /* Here we are first declaring our class that will act as the * base for other panels or in other terms the base for CardLayout. */ public class CardLayoutTest { private static final String CARD_JBUTTON = "Card

Subset panel data by group [duplicate]

十年热恋 提交于 2019-11-28 14:23:15
This question already has an answer here: How to select the first and last row within a grouping variable in a data frame? 3 answers I would like to subset an unbalanced panel data set by group. For each group, I would like to keep the two observations in the first and the last years. How do I best do this in R? For example: dt <- data.frame(name= rep(c("A", "B", "C"), c(3,2,3)), year=c(2001:2003,2000,2002,2000:2001,2003)) > dt name year 1 A 2001 2 A 2002 3 A 2003 4 B 2000 5 B 2002 6 C 2000 7 C 2001 8 C 2003 What I would like to have: name year 1 A 2001 3 A 2003 4 B 2000 5 B 2002 6 C 2000 8 C

updating a panel

半腔热情 提交于 2019-11-28 13:59:51
问题 I have a panel on my frame .and by clicking on a button I want to delete the old panel and make the other panel and add that panel to my frame.(also I use netbeans) would you please help me that how can i do that?thanks 回答1: JFrame frame = new JFrame(); final JPanel origPanel = new JPanel(); frame.add(origPanel, BorderLayout.CENTER); MouseListener ml = new MouseAdapter() { public void mouseClicked(MouseEvent evt) { // Mouse clicked on panel so remove existing panel and add a new one. frame

How to make Drop down panel in jQuery mobile 1.4.0?

筅森魡賤 提交于 2019-11-28 13:09:21
I have the following Panel in my jQuery mobile app , I want to make it to be drop down as appears in the following image rather than to be slide from the page edge . Is this can be done in jQuery mobile and How can i do this ? <div data-role="page" id="MainPage" > <div data-role="panel" id="Mainnavpanel" data-theme="b" data-display="overlay" data- position="right" data-position-fixed="true"> <ul data-role="listview"><li> <a href="#MainPageheader" data-rel="close" class="ui-btn" >Close</a></li> <li><a href="Page1.html" class="ui-btn" data-transition="none">Page1</a></li> <li><a href="Page2.html