JStatCard card = new JStatCard();card.setTitle("Total Revenue");card.setValue(45230.50);card.setPrefix("$");card.setDecimalPlaces(2);card.setTrend("+12.5% from last month", true);JIcon icon = new JIcon("dollar-sign");card.setIcon(icon.view(), "success");
Sets a trend indicator text with positive/negative styling.
Show Parameters
text (String): Trend description text, or null/empty to hide
isPositive (boolean): true for positive (green), false for negative (red)
card.setTrend("+12.5% from last month", true); // Green textcard.setTrend("-3.2% from last week", false); // Red textcard.setTrend(null, false); // Hide trend
// Revenue cardJStatCard revenueCard = new JStatCard();revenueCard.setTitle("Monthly Revenue");revenueCard.setPrefix("$");revenueCard.setDecimalPlaces(2);revenueCard.setValue(45230.50);revenueCard.setTrend("+12.5% vs last month", true);JIcon dollarIcon = new JIcon("dollar-sign");revenueCard.setIcon(dollarIcon.view(), "success");// Users cardJStatCard usersCard = new JStatCard();usersCard.setTitle("Active Users");usersCard.setValue(8234);usersCard.setTrend("+342 this week", true);JIcon usersIcon = new JIcon("users");usersCard.setIcon(usersIcon.view(), "primary");// Conversion rate cardJStatCard conversionCard = new JStatCard();conversionCard.setTitle("Conversion Rate");conversionCard.setSuffix("%");conversionCard.setDecimalPlaces(1);conversionCard.setValue(3.24);conversionCard.setTrend("-0.3% vs last month", false);JIcon chartIcon = new JIcon("trending-up");conversionCard.setIcon(chartIcon.view(), "warning");// Layout in dashboardHBox statsRow = new HBox(16, revenueCard, usersCard, conversionCard);